tls

package
v0.0.0-...-d8f7d12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestCertificate

func NewTestCertificate() (tls.Certificate, *x509.Certificate, error)

NewTestCertificate will return a self-signed certificate for IP address 127.0.0.1 that may be used for testing purposes.

Types

type Dialer

type Dialer interface {
	Dial(network, address string) (net.Conn, error)
}

Dialer defines a dialer that can be use to create connections.

type TlsDialer

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

func NewDialer

func NewDialer(dialer Dialer, config *tls.Config) *TlsDialer

NewDialer creates a Dialer that will use the provided dialer to create TLS connections. If the provided dialer is nil the default dialer is used. The TLS configuration to use is given by config, which is cloned. If config is nil the default configuration is used. A new (TLS) dialer is returned.

func (*TlsDialer) Dial

func (d *TlsDialer) Dial(network, address string) (net.Conn, error)

Dial will dial an address and returns a TLS connection.

Jump to

Keyboard shortcuts

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