tls

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertConfig added in v1.0.0

type CertConfig interface {
	// SetClientAuthType sets a client authentication type.
	SetClientAuthType(authType tls.ClientAuthType)
	// SetServerKey sets a SSL server key.
	SetServerKey(key []byte)
	// SetServerCert sets a SSL server certificate.
	SetServerCert(cert []byte)
	// SetRootCerts sets a SSL root certificates.
	SetRootCerts(certs ...[]byte)
	// SetServerKeyFile loads a SSL server key file and sets it.
	SetServerKeyFile(file string) error
	// SetServerCertFile loads a SSL server certificate file and sets it.
	SetServerCertFile(file string) error
	// SetRootCertFile loads SSL root certificate files and sets them.
	SetRootCertFiles(files ...string) error
	// SetTLSConfig sets a TLS configuration directly.
	// If the provided configuration is nil, TLS will be disabled.
	SetTLSConfig(tlsConfig *tls.Config)
	// TLSConfig returns a TLS configuration from the configuration.
	TLSConfig() (*tls.Config, error)
}

CertConfig represents a TLS configuration interface.

func NewCertConfig added in v1.0.0

func NewCertConfig() CertConfig

NewCertConfig returns a new TLS configuration.

type Conn

type Conn interface {
	ConnectionState() tls.ConnectionState
}

Conn represents a connection interface.

Jump to

Keyboard shortcuts

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