Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertReloader ¶
type CertReloader struct {
// contains filtered or unexported fields
}
CertReloader is the struct that parses a certificate/key pair, providing a goroutine safe GetCertificate method to retrieve the parsed content.
The GetCertificate signature is compatible with https://golang.org/pkg/crypto/tls/#Config.GetCertificate and can be used to hot-reload a certificate/key pair.
For hot-reloading the Watch method must be started explicitly.
func NewCertReloader ¶
func NewCertReloader(certPath, keyPath string, interval time.Duration) (*CertReloader, error)
func (*CertReloader) GetCertificate ¶
func (r *CertReloader) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns the current valid certificate. The ClientHello message is ignored and is just there to be compatible with https://golang.org/pkg/crypto/tls/#Config.GetCertificate.
Click to show internal directories.
Click to hide internal directories.