Documentation ¶
Index ¶
- type TLSConfigLoader
- func (t *TLSConfigLoader) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (t *TLSConfigLoader) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error)
- func (t *TLSConfigLoader) GetRootCAs() *x509.CertPool
- func (t *TLSConfigLoader) GetTLSConfig() *tls.Config
- func (t *TLSConfigLoader) Stop()
- func (t *TLSConfigLoader) Watch() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TLSConfigLoader ¶
type TLSConfigLoader struct {
// contains filtered or unexported fields
}
func NewTLSConfigLoader ¶
func NewTLSConfigLoader(caCertFile, certFile, keyFile string) (*TLSConfigLoader, error)
func (*TLSConfigLoader) GetCertificate ¶
func (t *TLSConfigLoader) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns the loaded certificate for use by the TLSConfig fields GetCertificate field in a http.Server.
func (*TLSConfigLoader) GetClientCertificate ¶
func (t *TLSConfigLoader) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error)
GetClientCertificate returns the loaded certificate for use by the TLSConfig fields GetClientCertificate field in a http.Server.
func (*TLSConfigLoader) GetRootCAs ¶
func (t *TLSConfigLoader) GetRootCAs() *x509.CertPool
GetRootCAs returns the cert pool to use to verify certificates.
func (*TLSConfigLoader) GetTLSConfig ¶
func (t *TLSConfigLoader) GetTLSConfig() *tls.Config
GetTLSConfig returns a tls.Config with auto reloading certs.
func (*TLSConfigLoader) Stop ¶
func (t *TLSConfigLoader) Stop()
Stop stops watching for changes to the certificate and key files.
func (*TLSConfigLoader) Watch ¶
func (t *TLSConfigLoader) Watch() error
Watch starts watching for changes to the certificate and key files. On any change the certificate and key are reloaded. If there is an issue the load will fail and the old (if any) certificates and keys will continue to be used.