Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateManager ¶
type CertificateManager struct { sync.RWMutex // Cache is used to speed up process start up and to avoid hitting any // rate limits imposed by the ACME server. Cache autocert.Cache // KnownHosts is a slice of hosts for whom the CertificateManager will try // to obtain tls certificates for. KnownHosts []string // ACMEClient is something that implements CertificateForDomainer (simple // wrapper around a golang.org/x/crypto/acme.Client). ACMEClient acme.CertificateForDomainer // RenewBefore represents how long before certificate expiration a new // certificate will be requested from the ACME server. RenewBefore time.Duration // contains filtered or unexported fields }
CertificateManager will obtain and cache TLS certificates from an ACME server. CertificateManager is inspired by autocert.Manager with the primary difference being pluggable challenge performers.
func (*CertificateManager) GetCertificate ¶
func (m *CertificateManager) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate is passed into a *tls.Config so that an *http.Server can automatically reload certificates. GetCertificate always retrieves certificates from a cache while a background go routine updates certificates.
func (*CertificateManager) Start ¶
func (m *CertificateManager) Start() error
Start is a blocking function that ensures the CertificateManager cache contains valid certificates for all known hosts. If it doesn't contain a cached TLS certificate, it requests one and put its in the cache.
Click to show internal directories.
Click to hide internal directories.