mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/tls: reject SNI values with a trailing dot.
SNI values may not include a trailing dot according to https://tools.ietf.org/html/rfc6066#section-3. Although crypto/tls handled this correctly as a client, it didn't reject this as a server. This change makes sending an SNI value with a trailing dot a fatal error. Updates #18114. Change-Id: Ib7897ab40e98d4a7a4646ff8469a55233621f631 Reviewed-on: https://go-review.googlesource.com/33904 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
e56be94375
commit
3f45916433
4 changed files with 19 additions and 2 deletions
|
|
@ -815,7 +815,7 @@ func hostnameInSNI(name string) string {
|
|||
if net.ParseIP(host) != nil {
|
||||
return ""
|
||||
}
|
||||
if len(name) > 0 && name[len(name)-1] == '.' {
|
||||
for len(name) > 0 && name[len(name)-1] == '.' {
|
||||
name = name[:len(name)-1]
|
||||
}
|
||||
return name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue