Versions in this module Expand all Collapse all v0 v0.6.0 Oct 11, 2026 Changes in this version + const AuthzX509AttrCert + const CertificateTypeRawPublicKey + const CertificateTypeX509 + const QUICEncryptionLevelApplication + const QUICEncryptionLevelEarly + const QUICEncryptionLevelHandshake + const QUICEncryptionLevelInitial + const TLS_AES_128_CCM_8_SHA256 + const TLS_AES_128_CCM_SHA256 + const TLS_AES_128_GCM_SHA256 + const TLS_AES_256_GCM_SHA384 + const TLS_CHACHA20_POLY1305_SHA256 + const TLS_DHE_PSK_WITH_AES_128_CBC_SHA + const TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 + const TLS_DHE_PSK_WITH_AES_128_CCM + const TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 + const TLS_DHE_PSK_WITH_AES_256_CBC_SHA + const TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 + const TLS_DHE_PSK_WITH_AES_256_CCM + const TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 + const TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 + const TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 + const TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 + const TLS_DH_RSA_WITH_AES_128_GCM_SHA256 + const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + const TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + const TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + const TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + const TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 + const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 + const TLS_ECDHE_ECDSA_WITH_RC4_128_SHA + const TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA + const TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 + const TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256 + const TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256 + const TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 + const TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA + const TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 + const TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384 + const TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 + const TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA + const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA + const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + const TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + const TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA + const TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + const TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 + const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 + const TLS_ECDHE_RSA_WITH_RC4_128_SHA + const TLS_FALLBACK_SCSV + const TLS_PSK_WITH_AES_128_CBC_SHA + const TLS_PSK_WITH_AES_128_CBC_SHA256 + const TLS_PSK_WITH_AES_128_CCM + const TLS_PSK_WITH_AES_128_CCM_8 + const TLS_PSK_WITH_AES_128_GCM_SHA256 + const TLS_PSK_WITH_AES_256_CBC_SHA + const TLS_PSK_WITH_AES_256_CBC_SHA384 + const TLS_PSK_WITH_AES_256_CCM + const TLS_PSK_WITH_AES_256_CCM_8 + const TLS_PSK_WITH_AES_256_GCM_SHA384 + const TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 + const TLS_RSA_WITH_3DES_EDE_CBC_SHA + const TLS_RSA_WITH_AES_128_CBC_SHA + const TLS_RSA_WITH_AES_128_CBC_SHA256 + const TLS_RSA_WITH_AES_128_GCM_SHA256 + const TLS_RSA_WITH_AES_256_CBC_SHA + const TLS_RSA_WITH_AES_256_GCM_SHA384 + const TLS_RSA_WITH_NULL_SHA256 + const TLS_RSA_WITH_RC4_128_SHA + const TLS_SHA256_SHA256 + const TLS_SHA384_SHA384 + const TrustedCertSHA1Hash + const TrustedKeySHA1Hash + const TrustedPreAgreed + const TrustedX509Name + const VersionSSL30 + const VersionTLS10 + const VersionTLS11 + const VersionTLS12 + const VersionTLS13 + var ErrInsecureRenegotiation = errors.New("tlsx: peer does not support secure renegotiation (RFC 5746)") + var ErrNotTLS12 = errors.New("tlsx: operation needs a TLS 1.2 connection") + var ErrNotTLS13 = errors.New("tlsx: operation needs a TLS 1.3 connection") + var ErrRenegotiationNotAllowed = errors.New("tlsx: renegotiation not allowed by the configuration") + var ErrRenegotiationRefusedByPeer = errors.New("tlsx: the server refused the renegotiation") + var ErrRenegotiationVersionChange = errors.New("tlsx: renegotiation changes the TLS version") + var ErrUnknownPSKIdentity = errors.New("tlsx: unknown PSK identity") + func AppendCertsFromPEM(pool *x509.CertPool, pemCerts []byte) bool + func CipherSuiteName(id uint16) string + func CreateCertificate(rand io.Reader, template, parent *x509.Certificate, pub crypto.PublicKey, ...) ([]byte, error) + func CreateStaticDHCertificate(rand io.Reader, template, parent *x509.Certificate, pub *DHPublicKey, ...) ([]byte, error) + func GODEBUGNonDefault(name string) uint64 + func GODEBUGValue(name string) string + func GenerateBrainpoolKey(id CurveID, rand io.Reader) (crypto.Signer, error) + func IsIntegrityOnly(id uint16) bool + func IsPSKSuite(id uint16) bool + func IsRSAPSSKey(cert *x509.Certificate) bool + func Listen(network, laddr string, config *Config) (net.Listener, error) + func MarshalPKCS8PrivateKey(k crypto.PrivateKey) ([]byte, error) + func MarshalStaticDHKey(k *DHPrivateKey) ([]byte, error) + func NewListener(inner net.Listener, config *Config) net.Listener + func ParseCertificate(der []byte) (*x509.Certificate, error) + func TrustedAuthoritiesMatch(chain [][]byte, list []TrustedAuthority) bool + func VersionName(version uint16) string + type AlertError uint8 + func (e AlertError) Error() string + type Certificate struct + Certificate [][]byte + ChainOCSPStaples [][]byte + Leaf *x509.Certificate + OCSPStaple []byte + PrivateKey crypto.PrivateKey + SignedCertificateTimestamps [][]byte + SupportedSignatureAlgorithms []SignatureScheme + func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) + func RawPublicKeyCertificate(key crypto.Signer) Certificate + func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) + type CertificateRequestInfo struct + AcceptableCAs [][]byte + SignatureSchemes []SignatureScheme + Version uint16 + func (c *CertificateRequestInfo) Context() context.Context + func (cri *CertificateRequestInfo) SupportsCertificate(c *Certificate) error + type CertificateVerificationError struct + Err error + UnverifiedCertificates []*x509.Certificate + func (e *CertificateVerificationError) Error() string + func (e *CertificateVerificationError) Unwrap() error + type CipherSuite struct + ID uint16 + Insecure bool + Name string + SupportedVersions []uint16 + func CipherSuites() []*CipherSuite + func InsecureCipherSuites() []*CipherSuite + type ClientAuthType int + const NoClientCert + const RequestClientCert + const RequireAndVerifyClientCert + const RequireAnyClientCert + const VerifyClientCertIfGiven + func (i ClientAuthType) String() string + type ClientHelloInfo struct + CipherSuites []uint16 + Conn net.Conn + Ext HelloExt + Extensions []uint16 + HelloRetryRequest bool + ServerName string + SignatureSchemes []SignatureScheme + SupportedCurves []CurveID + SupportedPoints []uint8 + SupportedProtos []string + SupportedVersions []uint16 + func (c *ClientHelloInfo) Context() context.Context + func (chi *ClientHelloInfo) SupportsCertificate(c *Certificate) error + type ClientSessionCache interface + Get func(sessionKey string) (session *ClientSessionState, ok bool) + Put func(sessionKey string, cs *ClientSessionState) + func NewLRUClientSessionCache(capacity int) ClientSessionCache + type ClientSessionState struct + func NewResumptionState(ticket []byte, state *SessionState) (*ClientSessionState, error) + func (cs *ClientSessionState) ResumptionState() (ticket []byte, state *SessionState, err error) + type Config struct + Certificates []Certificate + CipherSuites []uint16 + ClientAuth ClientAuthType + ClientCAs *x509.CertPool + ClientSessionCache ClientSessionCache + CurvePreferences []CurveID + DynamicRecordSizingDisabled bool + EncryptedClientHelloConfigList []byte + EncryptedClientHelloKeys []EncryptedClientHelloKey + EncryptedClientHelloRejectionVerify func(ConnectionState) error + Ext ConfigExt + GetCertificate func(*ClientHelloInfo) (*Certificate, error) + GetClientCertificate func(*CertificateRequestInfo) (*Certificate, error) + GetConfigForClient func(*ClientHelloInfo) (*Config, error) + GetEncryptedClientHelloKeys func(*ClientHelloInfo) ([]EncryptedClientHelloKey, error) + InsecureSkipVerify bool + KeyLogWriter io.Writer + MaxVersion uint16 + MinVersion uint16 + NameToCertificate map[string]*Certificate + NextProtos []string + PreferServerCipherSuites bool + Rand io.Reader + Renegotiation RenegotiationSupport + RootCAs *x509.CertPool + ServerName string + SessionTicketKey [32]byte + SessionTicketsDisabled bool + Time func() time.Time + UnwrapSession func(identity []byte, cs ConnectionState) (*SessionState, error) + VerifyConnection func(ConnectionState) error + VerifyPeerCertificate func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error + WrapSession func(ConnectionState, *SessionState) ([]byte, error) + func (c *Config) BuildNameToCertificate() + func (c *Config) Clone() *Config + func (c *Config) DecryptTicket(identity []byte, cs ConnectionState) (*SessionState, error) + func (c *Config) EncryptTicket(cs ConnectionState, ss *SessionState) ([]byte, error) + func (c *Config) SetSessionTicketKeys(keys [][32]byte) + type ConfigExt struct + AcceptAttributeCertificates bool + AcceptRenegotiation bool + AllowSHA1Signatures bool + AttributeCertificates [][]byte + CertificateAuthorities [][]byte + CipherSuitesTLS13 []uint16 + ClientSessionIDs bool + EncryptThenMAC bool + MaxFragmentLength uint8 + MinKeyUpdateInterval time.Duration + Observer func(c *Conn, e Event) + PSK *PSKConfig + RawPublicKeys *RawPublicKeyConfig + RequestOCSPMulti bool + RequireEncryptThenMAC bool + ServerSessionCache ServerSessionCache + SignatureSchemes []SignatureScheme + StaticDHCertificate *Certificate + TrustedCAKeys []TrustedAuthority + type Conn struct + func Client(conn net.Conn, config *Config) *Conn + func Dial(network, addr string, config *Config) (*Conn, error) + func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*Conn, error) + func Server(conn net.Conn, config *Config) *Conn + func (c *Conn) Close() error + func (c *Conn) CloseWrite() error + func (c *Conn) ConnectionState() ConnectionState + func (c *Conn) Handshake() error + func (c *Conn) HandshakeContext(ctx context.Context) error + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) NetConn() net.Conn + func (c *Conn) OCSPResponse() []byte + func (c *Conn) Read(b []byte) (int, error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) Renegotiate() error + func (c *Conn) RenegotiateContext(ctx context.Context, resume bool) (err error) + func (c *Conn) RequestRenegotiation() error + func (c *Conn) Resume() error + func (c *Conn) SendKeyUpdate(requestPeerUpdate bool) error + func (c *Conn) SetDeadline(t time.Time) error + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) VerifyHostname(host string) error + func (c *Conn) Write(b []byte) (int, error) + type ConnectionState struct + CipherSuite uint16 + CurveID CurveID + DidResume bool + ECHAccepted bool + Ext StateExt + HandshakeComplete bool + HelloRetryRequest bool + LocalCertificate [][]byte + NegotiatedProtocol string + NegotiatedProtocolIsMutual bool + OCSPResponse []byte + PeerCertificates []*x509.Certificate + ServerName string + SignedCertificateTimestamps [][]byte + TLSUnique []byte + VerifiedChains [][]*x509.Certificate + Version uint16 + func (cs *ConnectionState) ExportKeyingMaterial(label string, context []byte, length int) ([]byte, error) + type CurveID uint16 + const BrainpoolP256r1 + const BrainpoolP256r1TLS13 + const BrainpoolP384r1 + const BrainpoolP384r1TLS13 + const BrainpoolP512r1 + const BrainpoolP512r1TLS13 + const CurveP256 + const CurveP384 + const CurveP521 + const FFDHE2048 + const FFDHE3072 + const FFDHE4096 + const MLKEM1024 + const SecP256r1MLKEM768 + const SecP384r1MLKEM1024 + const X25519 + const X25519MLKEM768 + func (i CurveID) String() string + type DHPrivateKey struct + X *big.Int + func GenerateStaticDHKey(rand io.Reader) (*DHPrivateKey, error) + func ParseStaticDHKey(der []byte) (*DHPrivateKey, error) + func (k *DHPrivateKey) Public() crypto.PublicKey + type DHPublicKey struct + G *big.Int + P *big.Int + Q *big.Int + Y *big.Int + type Dialer struct + Config *Config + NetDialer *net.Dialer + func (d *Dialer) Dial(network, addr string) (net.Conn, error) + func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) + type ECHRejectionError struct + RetryConfigList []byte + func (e *ECHRejectionError) Error() string + type EncryptedClientHelloKey struct + Config []byte + PrivateKey []byte + SendAsRetry bool + type Event struct + ByPeer bool + Err error + Kind EventKind + PeerVersion uint16 + Requested bool + Resumed bool + Version uint16 + type EventKind int + const EventHelloRequestSent + const EventKeyUpdateReceived + const EventKeyUpdateSent + const EventRenegotiated + const EventRenegotiationFailed + const EventRenegotiationRefused + const EventRenegotiationStarted + type HelloExt struct + CertificateAuthorities [][]byte + EncryptThenMAC bool + MaxFragmentLength uint8 + PSKModes []uint8 + Renegotiation bool + SecureRenegotiation bool + StatusRequestV2 bool + TrustedCAKeys []TrustedAuthority + type PSKConfig struct + AllowNoDHE bool + ClientKey func(hint []byte) (identity, key []byte, err error) + Hash crypto.Hash + Hint []byte + Identity []byte + Key []byte + Lookup func(ctx context.Context, identity []byte) (key []byte, err error) + PreferNoDHE bool + Resumption bool + TLS13 bool + type QUICConfig struct + ClientHelloInfoConn net.Conn + EnableSessionEvents bool + TLSConfig *Config + type QUICConn struct + func QUICClient(config *QUICConfig) *QUICConn + func QUICServer(config *QUICConfig) *QUICConn + func (q *QUICConn) Close() error + func (q *QUICConn) ConnectionState() ConnectionState + func (q *QUICConn) HandleData(level QUICEncryptionLevel, data []byte) error + func (q *QUICConn) NextEvent() QUICEvent + func (q *QUICConn) SendSessionTicket(opts QUICSessionTicketOptions) error + func (q *QUICConn) SetTransportParameters(params []byte) + func (q *QUICConn) Start(ctx context.Context) error + func (q *QUICConn) StoreSession(session *SessionState) error + type QUICEncryptionLevel int + func (l QUICEncryptionLevel) String() string + type QUICEvent struct + Data []byte + Err error + Kind QUICEventKind + Level QUICEncryptionLevel + SessionState *SessionState + Suite uint16 + type QUICEventKind int + const QUICErrorEvent + const QUICHandshakeDone + const QUICNoEvent + const QUICRejectedEarlyData + const QUICResumeSession + const QUICSetReadSecret + const QUICSetWriteSecret + const QUICStoreSession + const QUICTransportParameters + const QUICTransportParametersRequired + const QUICWriteData + type QUICSessionTicketOptions struct + EarlyData bool + Extra [][]byte + type RawPublicKeyConfig struct + RawOnly bool + Send bool + Verify func(spki []byte) error + type RecordHeaderError struct + Conn net.Conn + Msg string + RecordHeader [5]byte + func (e RecordHeaderError) Error() string + type RenegotiationSupport int + const RenegotiateFreelyAsClient + const RenegotiateNever + const RenegotiateOnceAsClient + type ServerSessionCache interface + Get func(sessionID string) (*SessionState, bool) + Put func(sessionID string, s *SessionState) + type SessionState struct + EarlyData bool + Extra [][]byte + func ParseSessionState(data []byte) (*SessionState, error) + func (s *SessionState) Bytes() ([]byte, error) + type SignatureScheme uint16 + const ECDSABrainpoolP256r1TLS13WithSHA256 + const ECDSABrainpoolP384r1TLS13WithSHA384 + const ECDSABrainpoolP512r1TLS13WithSHA512 + const ECDSAWithP256AndSHA256 + const ECDSAWithP384AndSHA384 + const ECDSAWithP521AndSHA512 + const ECDSAWithSHA1 + const Ed25519 + const MLDSA44 + const MLDSA65 + const MLDSA87 + const PKCS1WithSHA1 + const PKCS1WithSHA256 + const PKCS1WithSHA384 + const PKCS1WithSHA512 + const PSSPSSWithSHA256 + const PSSPSSWithSHA384 + const PSSPSSWithSHA512 + const PSSWithSHA256 + const PSSWithSHA384 + const PSSWithSHA512 + func (i SignatureScheme) String() string + type StateExt struct + EncryptThenMAC bool + Handshakes int + KeyUpdatesReceived uint64 + KeyUpdatesSent uint64 + LastKeyUpdateReceived time.Time + MaxFragmentLength int + OCSPResponses [][]byte + OwnRawPublicKey bool + PSKIdentity []byte + PSKIdentityHint []byte + PeerAttributeCertificates [][]byte + PeerCertificateAuthorities [][]byte + PeerRawPublicKey []byte + SHA1Signature bool + SecureRenegotiation bool + SessionCreated time.Time + TrustedCAKeysAcknowledged bool + type TrustedAuthority struct + Data []byte + Type uint8 + func TrustedAuthoritiesFor(cas [][]byte) ([]TrustedAuthority, error)