tls

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET                          = HttpMethod(0)
	POST                         = HttpMethod(1)
	HTTPGET                      = "GET"
	HTTPPOST                     = "POST"
	DOHMediaType                 = "application/dns-message"
	DoTDefaultPort               = 853
	MaxHTTPBodyLength            = 4000000
	TLS_AES_128_GCM_SHA256       = 0x1301 // 16bytes key
	TLS_AES_256_GCM_SHA384       = 0x1302 // 1st not pq ready
	TLS_CHACHA20_POLY1305_SHA256 = 0x1303 // 2nd not pq ready
)

Variables

This section is empty.

Functions

func InitTLS13 added in v1.2.0

func InitTLS13()

func NewZTransport added in v1.2.0

func NewZTransport(alive time.Duration, timeout time.Duration) (t *http.Transport)

Types

type HttpMethod added in v1.2.0

type HttpMethod uint8

type PinningError added in v1.2.0

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

func (*PinningError) Error added in v1.2.0

func (e *PinningError) Error() string

type TLSMeta added in v1.2.0

type TLSMeta struct {
	*protocols.NetworkBase
	*tls.Config
	IPs            *atomic.Value //*EPRing or string of single endpoint
	Name           *string       //redundant key: name of stamp for now
	DomainName     string
	SNIShadow      string
	SNIBlotUp      stamps.SNIBlotUpType
	Pinnings       [][]byte
	DefaultContext context.Context //TLSContext or HTTPSContext
}

to reduce memory payload, shift http's Transport and ensure single instance of it now give up calling CloseIdleConnections method which has side effect on burst connections with different cm since we use custom dial on Transport with variant of tls config, have to cover all the proxies usage upon TLS

func NewTLSMeta added in v1.2.0

func NewTLSMeta(server *common.RegisteredServer, network *protocols.NetworkBase, disableTLSSession bool) *TLSMeta

func (*TLSMeta) FetchDoT added in v1.2.0

func (sm *TLSMeta) FetchDoT(_ string, ctx context.Context, msg *[]byte, timeout time.Duration, cbs ...interface{}) (*[]byte, error)

I don't foresee any benefit from dtls, so let's wait for DNS over QUIC

func (*TLSMeta) FetchHTTPS added in v1.2.0

func (sm *TLSMeta) FetchHTTPS(trans *http.Transport, domain, path *string, method HttpMethod, doh bool, ctx context.Context, body *[]byte, timeout time.Duration, cbs ...interface{}) (*[]byte, error)

func (*TLSMeta) Get added in v1.2.0

func (sm *TLSMeta) Get(trans *http.Transport, domain, path *string, ctx context.Context, timeout time.Duration) (*[]byte, error)

func (*TLSMeta) Post added in v1.2.0

func (sm *TLSMeta) Post(trans *http.Transport, domain, path *string, ctx context.Context, body *[]byte, timeout time.Duration) (*[]byte, error)

Jump to

Keyboard shortcuts

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