security

package
v0.0.0-...-ab4bdeb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultCertExpiration = 24 * 90 * time.Hour

Variables

This section is empty.

Functions

func BuildClientTLSConfig

func BuildClientTLSConfig(logger *zap.Logger, cfg config.TLSConfig) (*tls.Config, error)

func CreateTLSCertificates

func CreateTLSCertificates(logger *zap.Logger, certpath, keypath, capath string, rsaKeySize int, expiration time.Duration) error

func CreateTLSConfigForTest

func CreateTLSConfigForTest() (serverTLSConf *tls.Config, clientTLSConf *tls.Config, err error)

CreateTLSConfigForTest is from https://gist.github.com/shaneutt/5e1995295cff6721c89a71d13a71c251.

func GetMinTLSVer

func GetMinTLSVer(tlsVerStr string, logger *zap.Logger) uint16

GetMinTLSVer parses the min tls version from config and reports warning if necessary.

Types

type CertInfo

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

func NewCert

func NewCert(server bool) *CertInfo

func (*CertInfo) Reload

func (ci *CertInfo) Reload(lg *zap.Logger) (tlsConfig *tls.Config, err error)

func (*CertInfo) SetConfig

func (ci *CertInfo) SetConfig(cfg config.TLSConfig)

Jump to

Keyboard shortcuts

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