mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "crypto/tls: don't send IP literals as SNI values."
This reverts commit a4dcc69201.
Change-Id: Ib55fd349a604d6b5220dac20327501e1ce46b962
Reviewed-on: https://go-review.googlesource.com/16770
Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
parent
a4dcc69201
commit
b46df69541
3 changed files with 2 additions and 37 deletions
|
|
@ -49,20 +49,13 @@ func (c *Conn) clientHandshake() error {
|
|||
return errors.New("tls: NextProtos values too large")
|
||||
}
|
||||
|
||||
sni := c.config.ServerName
|
||||
// IP address literals are not permitted as SNI values. See
|
||||
// https://tools.ietf.org/html/rfc6066#section-3.
|
||||
if net.ParseIP(sni) != nil {
|
||||
sni = ""
|
||||
}
|
||||
|
||||
hello := &clientHelloMsg{
|
||||
vers: c.config.maxVersion(),
|
||||
compressionMethods: []uint8{compressionNone},
|
||||
random: make([]byte, 32),
|
||||
ocspStapling: true,
|
||||
scts: true,
|
||||
serverName: sni,
|
||||
serverName: c.config.ServerName,
|
||||
supportedCurves: c.config.curvePreferences(),
|
||||
supportedPoints: []uint8{pointFormatUncompressed},
|
||||
nextProtoNeg: len(c.config.NextProtos) > 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue