Skip to content

Commit

Permalink
crypto/tls: Conn.ConnectionState should set state.ServerName from c.s…
Browse files Browse the repository at this point in the history
…erverName unconditionally - handshakeComplete is not necessary for SNI (golang#15571)

Moves the state.ServerName assignment to outside the if statement that checks for handshakeComplete.
  • Loading branch information
amalaviy committed May 6, 2016
1 parent 009c002 commit 508797e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/tls/conn.go
Expand Up @@ -1209,6 +1209,7 @@ func (c *Conn) ConnectionState() ConnectionState {

var state ConnectionState
state.HandshakeComplete = c.handshakeComplete
state.ServerName = c.serverName
if c.handshakeComplete {
state.Version = c.vers
state.NegotiatedProtocol = c.clientProtocol
Expand All @@ -1217,7 +1218,6 @@ func (c *Conn) ConnectionState() ConnectionState {
state.CipherSuite = c.cipherSuite
state.PeerCertificates = c.peerCertificates
state.VerifiedChains = c.verifiedChains
state.ServerName = c.serverName
state.SignedCertificateTimestamps = c.scts
state.OCSPResponse = c.ocspResponse
if !c.didResume {
Expand Down

0 comments on commit 508797e

Please sign in to comment.