tls

package
v0.5.0-dev33 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 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() (*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) GetClientTLSConfig added in v0.3.6

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

GetTLSConfig returns a tls.Config with auto reloading certs.

func (*TLSConfigLoader) GetRootCAs

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

GetRootCAs returns the cert pool to use to verify certificates.

func (*TLSConfigLoader) GetServerTLSConfig added in v0.3.6

func (t *TLSConfigLoader) GetServerTLSConfig(clientAuthType tls.ClientAuthType) *tls.Config

func (*TLSConfigLoader) SetClientCACertificate added in v0.3.6

func (t *TLSConfigLoader) SetClientCACertificate(caCertificateFile string) error

func (*TLSConfigLoader) SetClientCertificate added in v0.3.6

func (t *TLSConfigLoader) SetClientCertificate(certificateFile, keyFile string) error

func (*TLSConfigLoader) SetServerCACertificate added in v0.3.6

func (t *TLSConfigLoader) SetServerCACertificate(caCertificateFile string) error

func (*TLSConfigLoader) SetServerCertificate added in v0.3.6

func (t *TLSConfigLoader) SetServerCertificate(certificateFile, keyFile string) error

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

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