Documentation
¶
Overview ¶
Package certmanager provides automatic TLS certificate provisioning via Let's Encrypt (ACME). It wraps golang.org/x/crypto/acme/autocert and exposes helpers for the web server and DoT server to share certificates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertInfo ¶
type CertInfo struct {
Domain string `json:"domain"`
Issuer string `json:"issuer"`
Subject string `json:"subject"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
DNSNames []string `json:"dns_names"`
AutoTLS bool `json:"auto_tls"`
ACME bool `json:"acme"`
}
CertInfo describes the currently active certificate.
func InfoFromStatic ¶
InfoFromStatic returns CertInfo by reading a static cert+key file pair.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager wraps autocert.Manager and provides certificate status inspection.
func New ¶
New creates a new certificate manager. cacheDir is the directory where certs are stored on disk. If staging is true, the Let's Encrypt staging endpoint is used (for testing).
func (*Manager) ForceRenew ¶
ForceRenew removes the cached certificate so autocert provisions a new one on the next TLS handshake.
func (*Manager) HTTPHandler ¶
HTTPHandler returns an http.Handler that serves ACME HTTP-01 challenges and redirects all other traffic to HTTPS. Use this on port 80.