-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: Insufficient verification of ServerName when certificate is wildcard #27591
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
Comments
Hmm, yeah that should not succeed, but we can't just apply verifyHostname, as there are a bunch of non-PKI users that put all sorts of things in the SAN (like the CloudSQL However, we can probably make it a requirement for wildcard matching, as wildcards are only meaningfully defined over hostnames. |
Change https://golang.org/cl/131575 mentions this issue: |
oh i didn't know that. thx you for teaching me. I tried to verify the hostname only when wildcards are used. |
Hi! |
Change https://golang.org/cl/231378 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
see https://play.golang.org/p/VeX1YzLJKk1
Since it seems that network request can not be done in the play environment, try it locally
As in the sample code above, if the certificate used in the host name of the communication destination is a wild card, since the verification of ServerName specified by
tls.Config{ServerName: u}
is insufficient, including URLScheme etc. Even though it can pass.If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Should not display error as hostname incorrect
What did you see instead?
HTTPS request succeed
The text was updated successfully, but these errors were encountered: