You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.6.1
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
What did you do?
Called c.ConnectionState() on a connection that failed Handshake() intentionally. c.serverName is set correctly, but ConnectionState() doesn't copy it over to state.ServerName due to unnecessary check for handshakeComplete. SNI is plaintext, it does not need to check for handshakeComplete - it is available even on failure and is purely a TLS clientHello field and is useful to have available for logging.
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?
c.ConnectionState().ServerName to be filled with the SNI set by the tls client.
What did you see instead?
c.Connectionstate().ServerName == ""
The text was updated successfully, but these errors were encountered:
amalaviy
changed the title
tls.ConnectionState() should set state.ServerName from c.serverName unconditionally - handshakeComplete is not necessary for SNI
tls.Conn.ConnectionState() should set state.ServerName from c.serverName unconditionally - handshakeComplete is not necessary for SNI
May 6, 2016
bradfitz
changed the title
tls.Conn.ConnectionState() should set state.ServerName from c.serverName unconditionally - handshakeComplete is not necessary for SNI
crypto/tls: Conn.ConnectionState should set state.ServerName from c.serverName unconditionally - handshakeComplete is not necessary for SNI
May 6, 2016
…erverName unconditionally - handshakeComplete is not necessary for SNI (golang#15571)
Moves the state.ServerName assignment to outside the if statement that checks for handshakeComplete.
Moves the state.ServerName assignment to outside the if
statement that checks for handshakeComplete.
Fixesgolang#15571
Change-Id: I6c4131ddb16389aed1c410a975f9aa3b52816965
Reviewed-on: https://go-review.googlesource.com/22862
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Moves the state.ServerName assignment to outside the if
statement that checks for handshakeComplete.
Fixesgolang#15571
Change-Id: I6c4131ddb16389aed1c410a975f9aa3b52816965
Reviewed-on: https://go-review.googlesource.com/22862
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Please answer these questions before submitting your issue. Thanks!
go version
)?go1.6.1
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
Called c.ConnectionState() on a connection that failed Handshake() intentionally. c.serverName is set correctly, but ConnectionState() doesn't copy it over to state.ServerName due to unnecessary check for handshakeComplete. SNI is plaintext, it does not need to check for handshakeComplete - it is available even on failure and is purely a TLS clientHello field and is useful to have available for logging.
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
c.ConnectionState().ServerName to be filled with the SNI set by the tls client.
c.Connectionstate().ServerName == ""
The text was updated successfully, but these errors were encountered: