Versions in this module Expand all Collapse all v1 v1.0.0 May 22, 2024 Changes in this version + const ExtensionALPN + const ExtensionCertificateAuthorities + const ExtensionCompressCertificate + const ExtensionCookie + const ExtensionEarlyData + const ExtensionEncryptThenMac + const ExtensionExtendedMasterSecret + const ExtensionHeartbeat + const ExtensionKeyShare + const ExtensionMaxFragmentLength + const ExtensionPSKModes + const ExtensionPreSharedKey + const ExtensionRecordSizeLimit + const ExtensionRenegotiationInfo + const ExtensionSCT + const ExtensionServerName + const ExtensionSessionTicket + const ExtensionSignatureAlgorithms + const ExtensionSignatureAlgorithmsCert + const ExtensionStatusRequest + const ExtensionSupportedCurves + const ExtensionSupportedPoints + const ExtensionSupportedVersions + const TLS_AES_128_GCM_SHA256 + const TLS_AES_256_GCM_SHA384 + const TLS_CHACHA20_POLY1305_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_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_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_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_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_RC4_128_SHA + const VersionSSL30 + const VersionTLS10 + const VersionTLS11 + const VersionTLS12 + const VersionTLS13 + var GreaseValues = []uint16 + func CipherSuiteName(id uint16) string + func Listen(network, laddr string, config *Config) (net.Listener, error) + func NewListener(inner net.Listener, config *Config) net.Listener + type Alert alert + func (a Alert) GetCode() uint8 + func (a Alert) GetDescription() string + type Certificate struct + Certificate [][]byte + Leaf *x509.Certificate + OCSPStaple []byte + PrivateKey crypto.PrivateKey + SignedCertificateTimestamps [][]byte + SupportedSignatureAlgorithms []SignatureScheme + func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) + func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) + type CertificateRequestInfo struct + AcceptableCAs [][]byte + SignatureSchemes []SignatureScheme + Version uint16 + func (cri *CertificateRequestInfo) SupportsCertificate(c *Certificate) 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 + type ClientHelloInfo struct + CipherSuites []uint16 + Conn net.Conn + ServerName string + SignatureSchemes []SignatureScheme + SupportedCurves []CurveID + SupportedPoints []uint8 + SupportedProtos []string + SupportedVersions []uint16 + func (chi *ClientHelloInfo) SupportsCertificate(c *Certificate) error + type ClientHelloMsg struct + AlpnProtocols []string + CipherSuites []uint16 + CompressionMethods []uint8 + Cookie []byte + EarlyData bool + KeyShares []KeyShare + OcspStapling bool + PskBinders [][]byte + PskIdentities []pskIdentity + PskModes []uint8 + Random []byte + Raw []byte + Scts bool + SecureRenegotiation []byte + SecureRenegotiationSupported bool + ServerName string + SessionId []byte + SessionTicket []uint8 + SupportedCurves []CurveID + SupportedPoints []uint8 + SupportedSignatureAlgorithms []SignatureScheme + SupportedSignatureAlgorithmsCert []SignatureScheme + SupportedVersions []uint16 + TicketSupported bool + Vers uint16 + func NewClientHelloMsg(m *clientHelloMsg) ClientHelloMsg + type ClientHelloPreset struct + Alpn []string + Ciphers []uint16 + CompressionMethods []uint8 + EcPointFormats []uint8 + EncryptThenMac bool + ExtendedMasterSecret bool + GreaseExtension uint16 + Heartbeat uint8 + KeyShares uint + MaxFragmentLength uint8 + Padding uint + PskKeyExchangeModes []uint8 + RecordSizeLimit uint16 + Renegotiation RenegotiationSupport + RenegotiationInfo bool + ReversedExtensionOrder bool + Sct bool + SessionTicket bool + SignatureAlgorithms []SignatureScheme + StatusRequest bool + SupportedGroups []CurveID + SupportedVersions []uint16 + Version uint16 + 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 + type Config struct + Certificates []Certificate + CipherSuites []uint16 + ClientAuth ClientAuthType + ClientCAs *x509.CertPool + ClientHelloPreset *ClientHelloPreset + ClientSessionCache ClientSessionCache + CurvePreferences []CurveID + DynamicRecordSizingDisabled bool + GetCertificate func(*ClientHelloInfo) (*Certificate, error) + GetClientCertificate func(*CertificateRequestInfo) (*Certificate, error) + GetConfigForClient func(*ClientHelloInfo) (*Config, error) + InsecureSkipVerify bool + KeyLogWriter io.Writer + KeyShares uint + 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 + VerifyPeerCertificate func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error + func (c *Config) BuildNameToCertificate() + func (c *Config) Clone() *Config + func (c *Config) SetSessionTicketKeys(keys [][32]byte) + 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) LocalAddr() net.Addr + func (c *Conn) OCSPResponse() []byte + func (c *Conn) Read(b []byte) (int, error) + func (c *Conn) RemoteAddr() net.Addr + 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 + CertificateExtensions []Extension + CipherSuite uint16 + ClientHello *ClientHelloMsg + DidResume bool + Errors []error + HandshakeComplete bool + HelloRetryRequestExtensions []Extension + NegotiatedProtocol string + NegotiatedProtocolIsMutual bool + OCSPResponse []byte + PeerCertificates []*x509.Certificate + Pre13ECDHParams CurveID + RecvAlerts []Alert + SendAlerts []Alert + ServerCertRequestExtensions []Extension + ServerEncryptedExtensions []Extension + ServerExtensions []Extension + ServerHello *ServerHelloMsg + 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 CurveP256 + const CurveP384 + const CurveP521 + const X25519 + type Extension struct + Data []byte + Extension uint16 + type KeyShare struct + Data []byte + Group CurveID + 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 ServerHelloMsg struct + AlpnProtocol string + CipherSuite uint16 + CompressionMethod uint8 + Cookie []byte + OcspStapling bool + Random []byte + Raw []byte + Scts [][]byte + SecureRenegotiation []byte + SecureRenegotiationSupported bool + SelectedGroup CurveID + SelectedIdentity uint16 + SelectedIdentityPresent bool + ServerShare KeyShare + SessionId []byte + SupportedPoints []uint8 + SupportedVersion uint16 + TicketSupported bool + Vers uint16 + func NewServerHelloMsg(m *serverHelloMsg) ServerHelloMsg + type SignatureScheme uint16 + const ECDSAWithP256AndSHA256 + const ECDSAWithP384AndSHA384 + const ECDSAWithP521AndSHA512 + const ECDSAWithSHA1 + const Ed25519 + const PKCS1WithSHA1 + const PKCS1WithSHA256 + const PKCS1WithSHA384 + const PKCS1WithSHA512 + const PSSWithSHA256 + const PSSWithSHA384 + const PSSWithSHA512