certificate

package
v0.41.0 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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertWatcher

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

CertWatcher watches certificate and key files and reloads them if they change on disk.

func NewCertWatcher

func NewCertWatcher(certPath, keyPath string, reloadInterval time.Duration, logger *zap.SugaredLogger) (*CertWatcher, error)

NewCertWatcher creates a CertWatcher and watches the certificate and key files. It reloads the contents on file change. Make sure to stop the CertWatcher using Stop() upon destroy.

func (*CertWatcher) GetCertificate

func (cw *CertWatcher) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate returns the server certificate for a client-hello request.

func (*CertWatcher) Stop

func (cw *CertWatcher) Stop()

Stop shuts down the CertWatcher. Use this with `defer`.

Jump to

Keyboard shortcuts

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