Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertManager ¶
type CertManager interface { Listen(network, address string) (net.Listener, error) TLSConfig() *tls.Config }
CertManager is a stateful certificate manager built on top of golang.org/x/crypto/acme/(*autocert.Manager), which is itself in turn built on top of golang.org/x/crypto/(*acme.Client). It obtains and refreshes certificates automatically using "tls-alpn-01" or "http-01" challenge types, as well as providing them to a TLS server via tls.Config.
func NewTLSAutoCertManager ¶
func NewTLSAutoCertManager(hostPolicy autocert.HostPolicy, operatorEmail string, renewBefore time.Duration, cacheDir string) CertManager
NewTLSAutoCertManager creates a new automatic certificate manager with the specified configuration items.
hostPolicy determines which incoming connections will be accepted (see autocert.HostPolicy for more information).
operatorEmail is the contact email address to be submitted to the ACME server, and which will be put into the issued SSL certificates.
renewBefore specifies how early certificates should be renewed before they expire (e.g., time.Hour * 24).
cacheDir gives a directory which can be used as a certificate cache for storing SSL certificate information between invocations. If the directory does not exist, it will be created with 0700 permissions.
type HostPolicy ¶
type HostPolicy = autocert.HostPolicy