Documentation ¶
Index ¶
- func ValidateCertExpiry(certPEM []byte, now time.Time) error
- type CertReloadConfig
- type MemCertReloader
- func (w *MemCertReloader) Close() error
- func (w *MemCertReloader) GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error)
- func (w *MemCertReloader) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error)
- func (w *MemCertReloader) GetLatestCertificate() (*tls.Certificate, error)
- func (w *MemCertReloader) Reload() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertReloadConfig ¶
type CertReloadConfig struct { // CertKeyGetter gets the certificate and the private key. CertKeyGetter func() ([]byte, []byte, error) Logger func(fmt string, args ...interface{}) PollInterval time.Duration }
CertReloadConfig contains the config for cert reload.
type MemCertReloader ¶
type MemCertReloader struct {
// contains filtered or unexported fields
}
MemCertReloader reloads the (key, cert) pair by invoking the callback functions getter.
func NewCertReloader ¶
func NewCertReloader(config CertReloadConfig) (*MemCertReloader, error)
NewCertReloader returns a MemCertReloader that reloads the (key, cert) pair whenever the cert file changes on the filesystem.
func (*MemCertReloader) Close ¶
func (w *MemCertReloader) Close() error
Close stops the background refresh.
func (*MemCertReloader) GetCertificate ¶
func (w *MemCertReloader) GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns the latest known certificate and can be assigned to the GetCertificate member of the TLS config. For http.server use.
func (*MemCertReloader) GetClientCertificate ¶
func (w *MemCertReloader) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error)
GetClientCertificate returns the latest known certificate and can be assigned to the GetClientCertificate member of the TLS config. For http.client use.
func (*MemCertReloader) GetLatestCertificate ¶
func (w *MemCertReloader) GetLatestCertificate() (*tls.Certificate, error)
GetLatestCertificate returns the latest known certificate.
func (*MemCertReloader) Reload ¶
func (w *MemCertReloader) Reload() error
Reload reloads the certificate into the memory cache when the certificate is updated and valid.