Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TLSServerName for Node API Client #3127

Merged
merged 8 commits into from
Aug 29, 2017
Merged

Fix TLSServerName for Node API Client #3127

merged 8 commits into from
Aug 29, 2017

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Aug 29, 2017

This PR fixes the construction of the TLSServerName when connecting to a
node that has TLS enabled and adds tests for all possible permutations.

Fixes #3013
Fixes #3126

dadgar and others added 6 commits August 29, 2017 11:11
This PR fixes the construction of the TLSServerName when connecting to a
node that has TLS enabled and adds tests for all possible permutations.

Fixes #3013
api/api.go Outdated
type nodeLookup func(nodeID string, q *QueryOptions) (*Node, *QueryMeta, error)

// getNodeClientImpl is the implementation of creating a API client for
// contacting a node. It is takes a function to lookup the node such that it can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"It is takes" :)

api/api.go Outdated
@@ -316,6 +331,10 @@ func (c *Client) GetNodeClient(nodeID string, q *QueryOptions) (*Client, error)
region = q.Region
}

if region == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is a bit confusing with 329-332. Is there a way (case statement or "else if") to have region only be assigned a value once?

api/api.go Outdated
return c.getNodeClientImpl(nodeID, q, c.Nodes().Info)
}

// nodeLookup is used to lookup a node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a bit more detail in the comment here

@dadgar dadgar merged commit c85e8aa into master Aug 29, 2017
@dadgar dadgar deleted the b-tls-api branch August 29, 2017 23:11
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tls verification issues after update to 0.6.2 Retrieving stats from CLI doesn't properly support TLS
2 participants