tls

package
v1.10.0-alpha.24 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: GPL-2.0 Imports: 25 Imported by: 36

Documentation

Index

Constants

View Source
const (
	VersionTLS10 = 0x0301
	VersionTLS11 = 0x0302
	VersionTLS12 = 0x0303
	VersionTLS13 = 0x0304

	// Deprecated: SSLv3 is cryptographically broken, and is no longer
	// supported by this package. See golang.org/issue/32716.
	VersionSSL30 = 0x0300
)
View Source
const ACMETLS1Protocol = "acme-tls/1"

Variables

This section is empty.

Functions

func ECHKeygenDefault added in v1.4.3

func ECHKeygenDefault(host string, pqSignatureSchemesEnabled bool) (configPem string, keyPem string, err error)

func GenerateCertificate added in v1.6.0

func GenerateCertificate(timeFunc func() time.Time, serverName string) (*tls.Certificate, error)

func GenerateKeyPair

func GenerateKeyPair(timeFunc func() time.Time, serverName string, expire time.Time) (privateKeyPem []byte, publicKeyPem []byte, err error)

func NewDialer

func NewDialer(dialer N.Dialer, config Config) N.Dialer

func NewDialerFromOptions

func NewDialerFromOptions(ctx context.Context, router adapter.Router, dialer N.Dialer, serverAddress string, options option.OutboundTLSOptions) (N.Dialer, error)

func ParseTLSVersion

func ParseTLSVersion(version string) (uint16, error)

Types

type Config

type Config = aTLS.Config

func NewClient

func NewClient(ctx context.Context, serverAddress string, options option.OutboundTLSOptions) (Config, error)

func NewECHClient

func NewECHClient(ctx context.Context, serverAddress string, options option.OutboundTLSOptions) (Config, error)

func NewRealityClient added in v1.2.0

func NewRealityClient(ctx context.Context, serverAddress string, options option.OutboundTLSOptions) (Config, error)

func NewSTDClient

func NewSTDClient(ctx context.Context, serverAddress string, options option.OutboundTLSOptions) (Config, error)

func NewUTLSClient

func NewUTLSClient(ctx context.Context, serverAddress string, options option.OutboundTLSOptions) (Config, error)

type ConfigCompat added in v1.2.0

type ConfigCompat = aTLS.ConfigCompat

type Conn

type Conn = aTLS.Conn

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 added in v1.2.0

type ConnectionState = tls.ConnectionState

type Dialer

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

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Dialer) ListenPacket

func (d *Dialer) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

type STDClientConfig

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

func (*STDClientConfig) Client

func (s *STDClientConfig) Client(conn net.Conn) (Conn, error)

func (*STDClientConfig) Clone

func (s *STDClientConfig) Clone() Config

func (*STDClientConfig) Config

func (s *STDClientConfig) Config() (*STDConfig, error)

func (*STDClientConfig) NextProtos

func (s *STDClientConfig) NextProtos() []string

func (*STDClientConfig) ServerName

func (s *STDClientConfig) ServerName() string

func (*STDClientConfig) SetNextProtos

func (s *STDClientConfig) SetNextProtos(nextProto []string)

func (*STDClientConfig) SetServerName

func (s *STDClientConfig) SetServerName(serverName string)

type STDConfig

type STDConfig = tls.Config

type STDConn

type STDConn = tls.Conn

type STDServerConfig

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

func (*STDServerConfig) Client

func (c *STDServerConfig) Client(conn net.Conn) (Conn, error)

func (*STDServerConfig) Clone

func (c *STDServerConfig) Clone() Config

func (*STDServerConfig) Close

func (c *STDServerConfig) Close() error

func (*STDServerConfig) Config

func (c *STDServerConfig) Config() (*STDConfig, error)

func (*STDServerConfig) NextProtos

func (c *STDServerConfig) NextProtos() []string

func (*STDServerConfig) Server

func (c *STDServerConfig) Server(conn net.Conn) (Conn, error)

func (*STDServerConfig) ServerName

func (c *STDServerConfig) ServerName() string

func (*STDServerConfig) SetNextProtos

func (c *STDServerConfig) SetNextProtos(nextProto []string)

func (*STDServerConfig) SetServerName

func (c *STDServerConfig) SetServerName(serverName string)

func (*STDServerConfig) Start

func (c *STDServerConfig) Start() error

type ServerConfig

type ServerConfig = aTLS.ServerConfig

func NewECHServer added in v1.4.3

func NewECHServer(ctx context.Context, logger log.Logger, options option.InboundTLSOptions) (ServerConfig, error)

func NewRealityServer added in v1.2.0

func NewRealityServer(ctx context.Context, logger log.Logger, options option.InboundTLSOptions) (ServerConfig, error)

func NewSTDServer

func NewSTDServer(ctx context.Context, logger log.Logger, options option.InboundTLSOptions) (ServerConfig, error)

func NewServer

func NewServer(ctx context.Context, logger log.Logger, options option.InboundTLSOptions) (ServerConfig, error)

type ServerConfigCompat added in v1.2.0

type ServerConfigCompat = aTLS.ServerConfigCompat

type WithSessionIDGenerator added in v1.2.0

type WithSessionIDGenerator = aTLS.WithSessionIDGenerator

Jump to

Keyboard shortcuts

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