Documentation ¶
Overview ¶
Package certman provides live reloading of the certificate and key files used by the standard library http.Server. It defines a type, certMan, with methods watching and getting the files. Only valid certificate and key pairs are loaded and an optional logger can be passed to certman for logging providing it implements the logger interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertMan ¶
type CertMan struct {
// contains filtered or unexported fields
}
A CertMan represents a certificate manager able to watch certificate and key pairs for changes.
func New ¶
New creates a new certMan. The certFile and the keyFile are both paths to the location of the files. Relative and absolute paths are accepted.
func (*CertMan) GetCertificate ¶
func (cm *CertMan) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns the loaded certificate for use by the GetCertificate field in tls.Config.
func (*CertMan) GetClientCertificate ¶
func (cm *CertMan) GetClientCertificate(hello *tls.CertificateRequestInfo) (*tls.Certificate, error)
GetClientCertificate returns the loaded certificate for use by the GetClientCertificate field in tls.Config.