tls

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const RealityMaxShortIDLen = 8
View Source
const VersionTLS12 = utls.VersionTLS12
View Source
const VersionTLS13 = utls.VersionTLS13

Variables

This section is empty.

Functions

func BuildRemovedX25519MLKEM768HandshakeState

func BuildRemovedX25519MLKEM768HandshakeState(c *UConn) error

func BuildWebsocketHandshakeState

func BuildWebsocketHandshakeState(c *UConn) error

BuildWebsocketHandshakeState it will only send http/1.1 in its ALPN. Copy from https://github.com/XTLS/Xray-core/blob/main/transport/internet/tls/tls.go

func GetRealityConn

func GetRealityConn(ctx context.Context, conn net.Conn, fingerprint UClientHelloID, serverName string, realityConfig *RealityConfig) (net.Conn, error)

func GetTLSConnectionState

func GetTLSConnectionState(conn net.Conn) (tlsState tls.ConnectionState)

func NewListener

func NewListener(inner net.Listener, config *Config) net.Listener

func UCertificate

func UCertificate(it tls.Certificate) utls.Certificate

func UConfig

func UConfig(config *tls.Config) *utls.Config

Types

type Certificate

type Certificate = utls.Certificate

type Config

type Config = utls.Config

type Conn

type Conn = utls.Conn

func Client

func Client(c net.Conn, config *utls.Config) *Conn

func Server

func Server(c net.Conn, config *utls.Config) *Conn

type ConnectionState

type ConnectionState = utls.ConnectionState

type EncryptedClientHelloKey

type EncryptedClientHelloKey = utls.EncryptedClientHelloKey

type RealityConfig

type RealityConfig struct {
	PublicKey *ecdh.PublicKey
	ShortID   [RealityMaxShortIDLen]byte

	SupportX25519MLKEM768 bool
}

type UClientHelloID

type UClientHelloID = utls.ClientHelloID

func GetFingerprint

func GetFingerprint(clientFingerprint string) (UClientHelloID, bool)

type UConn

type UConn = utls.UConn

func UClient

func UClient(c net.Conn, config *utls.Config, fingerprint UClientHelloID) *UConn

Jump to

Keyboard shortcuts

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