MCPcopy Create free account
hub / github.com/XTLS/Go / ConnectionState

Struct ConnectionState

common.go:215–279  ·  view source on GitHub ↗

ConnectionState records basic TLS details about the connection.

Source from the content-addressed store, hash-verified

213
214// ConnectionState records basic TLS details about the connection.
215type ConnectionState struct {
216 // Version is the TLS version used by the connection (e.g. VersionTLS12).
217 Version uint16
218
219 // HandshakeComplete is true if the handshake has concluded.
220 HandshakeComplete bool
221
222 // DidResume is true if this connection was successfully resumed from a
223 // previous session with a session ticket or similar mechanism.
224 DidResume bool
225
226 // CipherSuite is the cipher suite negotiated for the connection (e.g.
227 // TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_AES_128_GCM_SHA256).
228 CipherSuite uint16
229
230 // NegotiatedProtocol is the application protocol negotiated with ALPN.
231 NegotiatedProtocol string
232
233 // NegotiatedProtocolIsMutual used to indicate a mutual NPN negotiation.
234 //
235 // Deprecated: this value is always true.
236 NegotiatedProtocolIsMutual bool
237
238 // ServerName is the value of the Server Name Indication extension sent by
239 // the client. It's available both on the server and on the client side.
240 ServerName string
241
242 // PeerCertificates are the parsed certificates sent by the peer, in the
243 // order in which they were sent. The first element is the leaf certificate
244 // that the connection is verified against.
245 //
246 // On the client side, it can't be empty. On the server side, it can be
247 // empty if Config.ClientAuth is not RequireAnyClientCert or
248 // RequireAndVerifyClientCert.
249 PeerCertificates []*x509.Certificate
250
251 // VerifiedChains is a list of one or more chains where the first element is
252 // PeerCertificates[0] and the last element is from Config.RootCAs (on the
253 // client side) or Config.ClientCAs (on the server side).
254 //
255 // On the client side, it's set if Config.InsecureSkipVerify is false. On
256 // the server side, it's set if Config.ClientAuth is VerifyClientCertIfGiven
257 // (and the peer provided a certificate) or RequireAndVerifyClientCert.
258 VerifiedChains [][]*x509.Certificate
259
260 // SignedCertificateTimestamps is a list of SCTs provided by the peer
261 // through the TLS handshake for the leaf certificate, if any.
262 SignedCertificateTimestamps [][]byte
263
264 // OCSPResponse is a stapled Online Certificate Status Protocol (OCSP)
265 // response provided by the peer for the leaf certificate, if any.
266 OCSPResponse []byte
267
268 // TLSUnique contains the "tls-unique" channel binding value (see RFC 5929,
269 // Section 3). This value will be nil for TLS 1.3 connections and for all
270 // resumed connections.
271 //
272 // Deprecated: there are conditions in which this value might not be unique

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected