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

Struct ClientHelloInfo

common.go:397–447  ·  view source on GitHub ↗

ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks.

Source from the content-addressed store, hash-verified

395// ClientHelloInfo contains information from a ClientHello message in order to
396// guide application logic in the GetCertificate and GetConfigForClient callbacks.
397type ClientHelloInfo struct {
398 // CipherSuites lists the CipherSuites supported by the client (e.g.
399 // TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256).
400 CipherSuites []uint16
401
402 // ServerName indicates the name of the server requested by the client
403 // in order to support virtual hosting. ServerName is only set if the
404 // client is using SNI (see RFC 4366, Section 3.1).
405 ServerName string
406
407 // SupportedCurves lists the elliptic curves supported by the client.
408 // SupportedCurves is set only if the Supported Elliptic Curves
409 // Extension is being used (see RFC 4492, Section 5.1.1).
410 SupportedCurves []CurveID
411
412 // SupportedPoints lists the point formats supported by the client.
413 // SupportedPoints is set only if the Supported Point Formats Extension
414 // is being used (see RFC 4492, Section 5.1.2).
415 SupportedPoints []uint8
416
417 // SignatureSchemes lists the signature and hash schemes that the client
418 // is willing to verify. SignatureSchemes is set only if the Signature
419 // Algorithms Extension is being used (see RFC 5246, Section 7.4.1.4.1).
420 SignatureSchemes []SignatureScheme
421
422 // SupportedProtos lists the application protocols supported by the client.
423 // SupportedProtos is set only if the Application-Layer Protocol
424 // Negotiation Extension is being used (see RFC 7301, Section 3.1).
425 //
426 // Servers can select a protocol by setting Config.NextProtos in a
427 // GetConfigForClient return value.
428 SupportedProtos []string
429
430 // SupportedVersions lists the TLS versions supported by the client.
431 // For TLS versions less than 1.3, this is extrapolated from the max
432 // version advertised by the client, so values other than the greatest
433 // might be rejected if used.
434 SupportedVersions []uint16
435
436 // Conn is the underlying net.Conn for the connection. Do not read
437 // from, or write to, this connection; that will cause the TLS
438 // connection to fail.
439 Conn net.Conn
440
441 // config is embedded by the GetCertificate or GetConfigForClient caller,
442 // for use with SupportsCertificate.
443 config *Config
444
445 // ctx is the context of the handshake that is in progress.
446 ctx context.Context
447}
448
449// Context returns the context of the handshake that is in progress.
450// This context is a child of the context passed to HandshakeContext,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected