Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CertCallbackRefreshDuration = 5 * time.Minute
CertCallbackRefreshDuration is exposed so that integration tests can crank up the reload speed.
Functions ¶
func AutoLoadTLSConfig ¶ added in v0.16.0
func AutoLoadTLSConfig(caFile, certFile, keyFile string, conn Connection) (*tls.Config, error)
AutoLoadTLSConfig returns a TLS configuration for the given CA, client certificate, key files that can be used to establish a TLS connection. If CA is not provided, the system cert pool will be used. If client certificate and key are provided, they will be used for client authentication. And a goroutine will be started to periodically refresh client certificates for this connection.
func CachingCertificateLoader ¶
func CachingCertificateLoader(certFile, keyFile string) func() (*tls.Certificate, error)
CachingCertificateLoader ensures that we don't hammer the filesystem when opening many connections the underlying cert files are read at most once every second
func StartClientCertRotating ¶
func StartClientCertRotating(reload reloadFunc, conn Connection)
Types ¶
type Connection ¶
type Connection interface {
Close() error
}
Click to show internal directories.
Click to hide internal directories.