tls

package
v0.3.6-dev20 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TLSConfigLoader

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

func NewTLSConfigLoader

func NewTLSConfigLoader(caCertFile, certFile, keyFile string) (*TLSConfigLoader, error)

func (*TLSConfigLoader) GetCertificate

func (t *TLSConfigLoader) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate returns the loaded certificate for use by the TLSConfig fields GetCertificate field in a http.Server.

func (*TLSConfigLoader) GetClientCertificate

func (t *TLSConfigLoader) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error)

GetClientCertificate returns the loaded certificate for use by the TLSConfig fields GetClientCertificate field in a http.Server.

func (*TLSConfigLoader) GetRootCAs

func (t *TLSConfigLoader) GetRootCAs() *x509.CertPool

GetRootCAs returns the cert pool to use to verify certificates.

func (*TLSConfigLoader) GetTLSConfig

func (t *TLSConfigLoader) GetTLSConfig() *tls.Config

GetTLSConfig returns a tls.Config with auto reloading certs.

func (*TLSConfigLoader) Stop

func (t *TLSConfigLoader) Stop()

Stop stops watching for changes to the certificate and key files.

func (*TLSConfigLoader) Watch

func (t *TLSConfigLoader) Watch() error

Watch starts watching for changes to the certificate and key files. On any change the certificate and key are reloaded. If there is an issue the load will fail and the old (if any) certificates and keys will continue to be used.

type TestEnv

type TestEnv struct {
	*test.TestEnv
	// contains filtered or unexported fields
}

func NewTestEnv

func NewTestEnv(testEnv *test.TestEnv) (*TestEnv, error)

func (*TestEnv) CreateCACertificate

func (t *TestEnv) CreateCACertificate() error

func (*TestEnv) CreateCertificate

func (t *TestEnv) CreateCertificate() error

func (*TestEnv) Shutdown

func (env *TestEnv) Shutdown() error

Jump to

Keyboard shortcuts

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