certificate

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CertReloadMessage = "Certificate and/or key have changed on disk and were reloaded."
)

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