Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certinel ¶
type Certinel struct {
// contains filtered or unexported fields
}
Certinel is a container for zero-hit tls.Certificate changes, by receiving new certificates from sentries and presenting the functions expected by Go's tls.Config{}. Reading certificates from a Certinel instance is safe across multiple goroutines.
func New ¶
New creates a Certinel that watches for changes with the provided Watcher. Takes an optional logger and errBack func. Both can be nil if you don't want to log or handle errors.
func (*Certinel) Close ¶
Close calls Close on the held Watcher instance. After closing it is no longer safe to use this Certinel instance.
func (*Certinel) GetCertificate ¶
func (c *Certinel) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns the current tls.Certificate instance. The function can be passed as the GetCertificate member in a tls.Config object. It is safe to call across multiple goroutines.
func (*Certinel) GetClientCertificate ¶
func (c *Certinel) GetClientCertificate(certificateRequest *tls.CertificateRequestInfo) (*tls.Certificate, error)
GetClientCertificate returns the current tls.Certificate instance. The function can be passed as the GetClientCertificate member in a tls.Config object. It is safe to call across multiple goroutines.