tls

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET                          = "GET"
	POST                         = "POST"
	DOHMediaType                 = "application/dns-message"
	DefaultKeepAlive             = 0 * time.Second
	DefaultTimeout               = 30 * time.Second
	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

This section is empty.

Types

type HTTPSContext

type HTTPSContext struct {
	context.Context
	TLSContextDial
}

soul of HTTPS

func (*HTTPSContext) Value

func (c *HTTPSContext) Value(key interface{}) interface{}

type TLSContextDial

type TLSContextDial func(ctx context.Context, network, addr string) (*string, net.Conn, error)

name, conn, err

type TransportHolding

type TransportHolding struct {
	*tls.Config
	IPs        *atomic.Value //*EPRing
	Name       *string       //redundant key: name of stamp for now
	DomainName string
	SNIShadow  string
	SNIBlotUp  stamps.SNIBlotUpType
	Context    *HTTPSContext
	Proxies    *conceptions.NestedProxy // individual proxies chain
}

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

func (*TransportHolding) BuildTLS

func (th *TransportHolding) BuildTLS(XTransport *XTransport) (cfg *tls.Config)

func (*TransportHolding) BuildTransport

func (th *TransportHolding) BuildTransport(XTransport *XTransport, proxies *conceptions.NestedProxy) error

type XTransport

type XTransport struct {
	*http.Transport
	Transports               map[string]*TransportHolding //key: name of stamp for now
	KeepAlive                time.Duration
	Timeout                  time.Duration
	TlsDisableSessionTickets bool
	Proxies                  *conceptions.NestedProxy
	LocalInterface           *string
}

upon TLS

func NewXTransport

func NewXTransport() *XTransport

func (*XTransport) BuildTLS

func (XTransport *XTransport) BuildTLS(server common.RegisteredServer) error

func (*XTransport) BuildTransport

func (XTransport *XTransport) BuildTransport(server common.RegisteredServer, _ *conceptions.NestedProxy) error

general template for all TLS conn;

func (*XTransport) FetchDoT

func (XTransport *XTransport) FetchDoT(name string, serverProto string, ctx *common.TLSContext, body *[]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 (*XTransport) FetchHTTPS

func (XTransport *XTransport) FetchHTTPS(name string, path string, method string, doh bool, ctx *HTTPSContext, body *[]byte, Timeout time.Duration, cbs ...interface{}) ([]byte, error)

func (*XTransport) Get

func (XTransport *XTransport) Get(name string, path string, ctx *HTTPSContext, Timeout time.Duration) ([]byte, error)

func (*XTransport) Post

func (XTransport *XTransport) Post(name string, path string, ctx *HTTPSContext, 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