security

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidTLSCertFile = errors.New("tls cert file path can not be empty")
	ErrInvalidTLSKeyFile  = errors.New("tls key file path can not be empty")
)

Functions

This section is empty.

Types

type TLSOption

type TLSOption struct {
	// CertFile is the path to the server certificate file.
	CertFile string
	// KeyFile is the path to the private key file.
	KeyFile string
	// CipherSuites is a list of supported cipher suites.
	CipherSuites []uint16
	// MinVersion is the minimum TLS version supported.
	MinVersion uint16
	// MaxVersion is the maximum TLS version supported.
	MaxVersion uint16
	// TrustedCaFile is the path to the CA certificate.
	TrustedCaFile string
	// InsecureSkipVerify controls whether it verifies the certificate chain and host name.
	InsecureSkipVerify bool
	// ServerName is the expected server name (for SNI) used when connecting to the server.
	ServerName string
	// ClientAuth controls whether the server requires clients to authenticate with a certificate.
	ClientAuth bool
}

func (*TLSOption) IsConfigured

func (tls *TLSOption) IsConfigured() bool

func (*TLSOption) MakeClientTLSConf

func (tls *TLSOption) MakeClientTLSConf() (*libtls.Config, error)

func (*TLSOption) MakeServerTLSConf

func (tls *TLSOption) MakeServerTLSConf() (*libtls.Config, error)

Jump to

Keyboard shortcuts

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