Versions in this module Expand all Collapse all v1 v1.3.0 Jun 27, 2021 Changes in this version + 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_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_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 + func Listen(network, laddr string, config *Config) (net.Listener, error) + func NewListener(inner net.Listener, config *Config) net.Listener + type Certificate struct + Certificate [][]byte + Leaf *sm2.Certificate + OCSPStaple []byte + PrivateKey crypto.PrivateKey + SignedCertificateTimestamps [][]byte + func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) + func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) + type CertificateRequestInfo struct + AcceptableCAs [][]byte + SignatureSchemes []SignatureScheme + 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 + 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 *sm2.CertPool + 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 + MaxVersion uint16 + MinVersion uint16 + NameToCertificate map[string]*Certificate + NextProtos []string + PreferServerCipherSuites bool + Rand io.Reader + Renegotiation RenegotiationSupport + RootCAs *sm2.CertPool + ServerName string + SessionTicketKey [32]byte + SessionTicketsDisabled bool + Time func() time.Time + VerifyPeerCertificate func(rawCerts [][]byte, verifiedChains [][]*sm2.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) (n int, err 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 + CipherSuite uint16 + DidResume bool + HandshakeComplete bool + NegotiatedProtocol string + NegotiatedProtocolIsMutual bool + OCSPResponse []byte + PeerCertificates []*sm2.Certificate + ServerName string + SignedCertificateTimestamps [][]byte + TLSUnique []byte + VerifiedChains [][]*sm2.Certificate + Version uint16 + type CurveID uint16 + const CureP256SM2 + const CurveP256 + const CurveP384 + const CurveP521 + const X25519 + 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 SignatureScheme uint16 + const ECDSAWithP256AndSHA256 + const ECDSAWithP384AndSHA384 + const ECDSAWithP521AndSHA512 + const PKCS1WithSHA1 + const PKCS1WithSHA256 + const PKCS1WithSHA384 + const PKCS1WithSHA512 + const PSSWithSHA256 + const PSSWithSHA384 + const PSSWithSHA512