tls

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-2.0 Imports: 4 Imported by: 58

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewListener

func NewListener(inner net.Listener, config ServerConfig) net.Listener

Types

type Config

type Config interface {
	ServerName() string
	SetServerName(serverName string)
	NextProtos() []string
	SetNextProtos(nextProto []string)
	Config() (*STDConfig, error)
	Client(conn net.Conn) (Conn, error)
	Clone() Config
}

type ConfigCompat

type ConfigCompat interface {
	Config
	ClientHandshake(ctx context.Context, conn net.Conn) (Conn, error)
}

type Conn

type Conn interface {
	net.Conn
	NetConn() net.Conn
	HandshakeContext(ctx context.Context) error
	ConnectionState() ConnectionState
}

func ClientHandshake

func ClientHandshake(ctx context.Context, conn net.Conn, config Config) (Conn, error)

func ServerHandshake

func ServerHandshake(ctx context.Context, conn net.Conn, config ServerConfig) (Conn, error)

type ConnectionState

type ConnectionState = tls.ConnectionState

type LazyConn

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

func NewLazyConn

func NewLazyConn(conn net.Conn, config ServerConfig) *LazyConn

func (*LazyConn) HandshakeContext

func (c *LazyConn) HandshakeContext(ctx context.Context) error

func (*LazyConn) NeedHandshake

func (c *LazyConn) NeedHandshake() bool

func (*LazyConn) Read

func (c *LazyConn) Read(p []byte) (n int, err error)

func (*LazyConn) ReaderReplaceable

func (c *LazyConn) ReaderReplaceable() bool

func (*LazyConn) Upstream

func (c *LazyConn) Upstream() any

func (*LazyConn) Write

func (c *LazyConn) Write(p []byte) (n int, err error)

func (*LazyConn) WriterReplaceable

func (c *LazyConn) WriterReplaceable() bool

type Listener

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

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

type STDConfig

type STDConfig = tls.Config

type STDConn

type STDConn = tls.Conn

type ServerConfig

type ServerConfig interface {
	Config
	Start() error
	Close() error
	Server(conn net.Conn) (Conn, error)
}

type ServerConfigCompat

type ServerConfigCompat interface {
	ServerConfig
	ServerHandshake(ctx context.Context, conn net.Conn) (Conn, error)
}

type WithSessionIDGenerator

type WithSessionIDGenerator interface {
	SetSessionIDGenerator(generator func(clientHello []byte, sessionID []byte) error)
}

Jump to

Keyboard shortcuts

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