cert

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL