Repository navigation
Hostname verification on by default - #1640
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flips the default of the hostname verification added in #1638: the certificate the server presents must be issued for the server name the connection was made with, unless the user turns the check off.
opentlsand a hand-supplied trust-all context.tlsVerifyHostname(false)on the builder, or theio.nats.client.tls.verify.hostname=falseproperty, turns it off.Options.Builder.tlsVerifyHostname(), unreleased, is replaced bytlsVerifyHostname(boolean).CertificateExceptionnaming the expected host. Reissue the certificate for the name, use the name the certificate carries in the url, or turn the check off.ReconnectTests: the three tests that use the certificate without an ip subject alternative name connected by127.0.0.1, which the default now rejects. Thetlsscheme test and the two-server cluster test connect bylocalhost, the name the certificate carries; in the cluster test the reconnect to the gossiped ip is verified against that name. Theopentlstest keeps the ip and turns the check off.OptionsTestscovers the default, the opt-out, the copy constructor and the property.TlsHostnameTestsruns the verifying cases on the default, the accepted-when-off cases withtlsVerifyHostname(false), and the discovered-ip reconnect with verification on by default plus an opt-out variant that shows SNI alone carries the hostname.