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 for changes. When either file changes, it reads and parses both and calls an optional callback with the new certificate.
func New ¶
func New(ctx context.Context, logger logger.LogContext, certPath, keyPath, cacertPath, cakeyPath string) (*CertWatcher, error)
New returns a new CertWatcher watching the given certificate and key.
func (*CertWatcher) GetCertificate ¶
func (this *CertWatcher) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate fetches the currently loaded certificate, which may be nil.
func (*CertWatcher) GetCertificateInfo ¶
func (this *CertWatcher) GetCertificateInfo() certmgmt.CertificateInfo
func (*CertWatcher) ReadCertificate ¶
func (this *CertWatcher) ReadCertificate() error
ReadCertificate reads the certificate and key files from disk, parses them, and updates the current certificate on the watcher. If a callback is set, it is invoked with the new certificate.
Click to show internal directories.
Click to hide internal directories.