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

clientconn: override authority with address's ServerName, if set #3073

Merged
merged 1 commit into from Oct 8, 2019

Conversation

jpbetz
Copy link
Contributor

@jpbetz jpbetz commented Oct 4, 2019

Fixes #3038

By default it is not set and the dialed target is used as the authority for all load balanced endpoints. This enables load balanced clients to use per-endpoint authorities when the address's ServerName is set.

@dfawley
Copy link
Member

dfawley commented Oct 4, 2019

Thanks for the PR @jpbetz. LGTM, but we should also document the new behavior on resolver.Address.ServerName, including a warning about being careful when using the field, e.g. don't use any untrusted I/O to populate this field or it could effectively defeat any security provided by TLS.

@dfawley dfawley self-requested a review October 4, 2019 20:39
@jpbetz jpbetz force-pushed the servername-authority-override branch from 5b34e15 to 8470538 Compare October 4, 2019 21:22
@jpbetz
Copy link
Contributor Author

jpbetz commented Oct 4, 2019

@dfawley godoc added to ServerName.

I've also downstream tested this change with etcd and it works as expected.

Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. A couple minor things related to the new text, otherwise LGTM.

resolver/resolver.go Outdated Show resolved Hide resolved
resolver/resolver.go Outdated Show resolved Hide resolved
@jpbetz jpbetz force-pushed the servername-authority-override branch from 8470538 to aae9b30 Compare October 8, 2019 20:12
@jpbetz
Copy link
Contributor Author

jpbetz commented Oct 8, 2019

Feedback applied

Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

Thanks again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use a custom authority for each connection in a single ClientConn
2 participants