tlsutil

package
v1.45.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFormatVersionMismatch = errors.New("format version mismatch")
)

Functions

func Curves

func Curves() []tls.CurveID

func EnableTLSCookies added in v1.44.0

func EnableTLSCookies(cfg *tls.Config, logger *clog.CondLogger) *tls.Config

func ExpectPeerName

func ExpectPeerName(name string, roots *x509.CertPool) func(cs tls.ConnectionState) error

func FormatVersion

func FormatVersion(v uint16) string

func LoadCAfile

func LoadCAfile(filename string) (*x509.CertPool, error)

func ParseCipherList

func ParseCipherList(ciphers string) ([]uint16, error)

func ParseCurveList

func ParseCurveList(curves string) ([]tls.CurveID, error)

func ParseVersion

func ParseVersion(s string) (uint16, error)

func TLSConfigFromURL added in v1.24.0

func TLSConfigFromURL(u *url.URL) (*tls.Config, error)

func TLSFactoryFromURL added in v1.28.0

func TLSFactoryFromURL(u *url.URL) (func(c net.Conn, config *tls.Config) net.Conn, error)

func TLSSessionIDToContext added in v1.44.0

func TLSSessionIDToContext(ctx context.Context, conn net.Conn) context.Context

Types

type ConnTagger added in v1.44.0

type ConnTagger interface {
	GetTag(any) (any, bool)
	SetTag(any, any)
}

type PersistentClientSessionCache added in v1.44.0

type PersistentClientSessionCache struct {
	// contains filtered or unexported fields
}

func NewPersistentClientSessionCache added in v1.44.0

func NewPersistentClientSessionCache(path string, logger *clog.CondLogger) (*PersistentClientSessionCache, error)

func (*PersistentClientSessionCache) Get added in v1.44.0

func (cache *PersistentClientSessionCache) Get(sessionKey string) (*tls.ClientSessionState, bool)

func (*PersistentClientSessionCache) Put added in v1.44.0

func (cache *PersistentClientSessionCache) Put(sessionKey string, cs *tls.ClientSessionState)

type TLSSessionID added in v1.44.0

type TLSSessionID = [16]byte

func GetTLSSessionID added in v1.44.0

func GetTLSSessionID(conn net.Conn) (TLSSessionID, bool)

func NewTLSSessionID added in v1.44.0

func NewTLSSessionID() (res TLSSessionID)

func TLSSessionIDFromContext added in v1.44.0

func TLSSessionIDFromContext(ctx context.Context) (TLSSessionID, bool)

func TLSSessionIDFromState added in v1.44.0

func TLSSessionIDFromState(ss *tls.SessionState) (TLSSessionID, bool)

type TaggedConn added in v1.44.0

type TaggedConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewTaggedConn added in v1.44.0

func NewTaggedConn(conn net.Conn) *TaggedConn

func (*TaggedConn) GetTag added in v1.44.0

func (c *TaggedConn) GetTag(key any) (any, bool)

func (*TaggedConn) SetTag added in v1.44.0

func (c *TaggedConn) SetTag(key, value any)

type TaggedConnListener added in v1.44.0

type TaggedConnListener struct {
	net.Listener
}

func NewTaggedConnListener added in v1.44.0

func NewTaggedConnListener(l net.Listener) TaggedConnListener

func (TaggedConnListener) Accept added in v1.44.0

func (l TaggedConnListener) Accept() (net.Conn, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL