tls

package
v2.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SizeRecordType = 1
	SizeVersion    = 2
	SizeSize       = 2
	SizeHeader     = SizeRecordType + SizeVersion + SizeSize

	MaxRecordSize        = 16384
	MaxRecordPayloadSize = MaxRecordSize - SizeHeader
	DefaultBufferSize    = 4096

	TypeChangeCipherSpec = 0x14
	TypeHandshake        = 0x16
	TypeApplicationData  = 0x17
)

Variables

View Source
var TLSVersion = [SizeVersion]byte{3, 3}

TLS 1.2 is used for both TLS 1.2 and 1.3

Functions

func ReadRecord

func ReadRecord(r io.Reader, w io.Writer) (byte, int64, error)

func WriteRecord

func WriteRecord(w io.Writer, payload []byte) error

func WriteRecordInPlace added in v2.2.2

func WriteRecordInPlace(w io.Writer, buf []byte, payloadLen int) error

Types

type Conn

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

Conn presents an established TLS 1.3 connection, after handshake

func New

func New(conn essentials.Conn, read, write bool) Conn

func (Conn) Read

func (c Conn) Read(p []byte) (int, error)

func (Conn) Write

func (c Conn) Write(p []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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