]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: document ConnectionState.NegotiatedProtocol more clearly
authorAnmol Sethi <anmol@aubble.com>
Sun, 29 Jan 2017 08:18:17 +0000 (03:18 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 1 Feb 2017 21:48:27 +0000 (21:48 +0000)
ConnectionState.NegotiatedProtocol's documentation implies that it will
always be from Config.NextProtos. This commit clarifies that there is no
guarantee.

This commit also adds a note to
ConnectionState.NegotiatedProtocolIsMutual, making it clear that it is
client side only.

Fixes #18841

Change-Id: Icd028af8042f31e45575f1080c5e9bd3012e03d7
Reviewed-on: https://go-review.googlesource.com/35917
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/crypto/tls/common.go

index 276d1761ea04033672d5ad0354327fa36bd34a4c..2ebb37bd409800b76979fc986537184a1ed4639d 100644 (file)
@@ -163,8 +163,8 @@ type ConnectionState struct {
        HandshakeComplete           bool                  // TLS handshake is complete
        DidResume                   bool                  // connection resumes a previous TLS connection
        CipherSuite                 uint16                // cipher suite in use (TLS_RSA_WITH_RC4_128_SHA, ...)
-       NegotiatedProtocol          string                // negotiated next protocol (from Config.NextProtos)
-       NegotiatedProtocolIsMutual  bool                  // negotiated protocol was advertised by server
+       NegotiatedProtocol          string                // negotiated next protocol (not guaranteed to be from Config.NextProtos)
+       NegotiatedProtocolIsMutual  bool                  // negotiated protocol was advertised by server (client side only)
        ServerName                  string                // server name requested by client, if any (server side only)
        PeerCertificates            []*x509.Certificate   // certificate chain presented by remote peer
        VerifiedChains              [][]*x509.Certificate // verified chains built from PeerCertificates