ConnectionState records basic TLS details about the connection.
| 233 | |
| 234 | // ConnectionState records basic TLS details about the connection. |
| 235 | type ConnectionState struct { |
| 236 | // Version is the TLS version used by the connection (e.g. VersionTLS12). |
| 237 | Version uint16 |
| 238 | |
| 239 | // HandshakeComplete is true if the handshake has concluded. |
| 240 | HandshakeComplete bool |
| 241 | |
| 242 | // DidResume is true if this connection was successfully resumed from a |
| 243 | // previous session with a session ticket or similar mechanism. |
| 244 | DidResume bool |
| 245 | |
| 246 | // CipherSuite is the cipher suite negotiated for the connection (e.g. |
| 247 | // TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_AES_128_GCM_SHA256). |
| 248 | CipherSuite uint16 |
| 249 | |
| 250 | // CurveID is the key exchange mechanism used for the connection. The name |
| 251 | // refers to elliptic curves for legacy reasons, see [CurveID]. If a legacy |
| 252 | // RSA key exchange is used, this value is zero. |
| 253 | CurveID CurveID |
| 254 | |
| 255 | // NegotiatedProtocol is the application protocol negotiated with ALPN. |
| 256 | NegotiatedProtocol string |
| 257 | |
| 258 | // NegotiatedProtocolIsMutual used to indicate a mutual NPN negotiation. |
| 259 | // |
| 260 | // Deprecated: this value is always true. |
| 261 | NegotiatedProtocolIsMutual bool |
| 262 | |
| 263 | // ServerName is the value of the Server Name Indication extension sent by |
| 264 | // the client. It's available both on the server and on the client side. |
| 265 | ServerName string |
| 266 | |
| 267 | // PeerCertificates are the parsed certificates sent by the peer, in the |
| 268 | // order in which they were sent. The first element is the leaf certificate |
| 269 | // that the connection is verified against. |
| 270 | // |
| 271 | // On the client side, it can't be empty. On the server side, it can be |
| 272 | // empty if Config.ClientAuth is not RequireAnyClientCert or |
| 273 | // RequireAndVerifyClientCert. |
| 274 | // |
| 275 | // PeerCertificates and its contents should not be modified. |
| 276 | PeerCertificates []*x509.Certificate |
| 277 | |
| 278 | // VerifiedChains is a list of one or more chains where the first element is |
| 279 | // PeerCertificates[0] and the last element is from Config.RootCAs (on the |
| 280 | // client side) or Config.ClientCAs (on the server side). |
| 281 | // |
| 282 | // On the client side, it's set if Config.InsecureSkipVerify is false. On |
| 283 | // the server side, it's set if Config.ClientAuth is VerifyClientCertIfGiven |
| 284 | // (and the peer provided a certificate) or RequireAndVerifyClientCert. |
| 285 | // |
| 286 | // VerifiedChains and its contents should not be modified. |
| 287 | VerifiedChains [][]*x509.Certificate |
| 288 | |
| 289 | // SignedCertificateTimestamps is a list of SCTs provided by the peer |
| 290 | // through the TLS handshake for the leaf certificate, if any. |
| 291 | SignedCertificateTimestamps [][]byte |
| 292 |
nothing calls this directly
no outgoing calls
no test coverage detected