Documentation
¶
Overview ¶
Package certs provides TLS certificates from Let's Encrypt for every host lfr serves (mail host, list websites, MTA-STS hosts), renewing them automatically, with a self-signed fallback so STARTTLS keeps working before DNS is in place.
Index ¶
- type Manager
- func (m *Manager) Challenge(next http.Handler) http.Handler
- func (m *Manager) Forget()
- func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (m *Manager) Inspect(host string) State
- func (m *Manager) SMTPCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (m *Manager) TLSConfig() *tls.Config
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
Dir string
Email func(ctx context.Context) string
DirURL func(ctx context.Context) string
Allowed func(ctx context.Context, host string) bool
Hostname func(ctx context.Context) string
// contains filtered or unexported fields
}
Manager hands out certificates.
func (*Manager) Challenge ¶
Challenge answers ACME HTTP-01 challenges and passes everything else to next. It works on port 80 and, behind a proxy that upgrades to HTTPS, on 443 too.
func (*Manager) Forget ¶
func (m *Manager) Forget()
Forget clears remembered failures, e.g. after DNS was fixed.
func (*Manager) GetCertificate ¶
func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate serves HTTPS and SMTP STARTTLS. Clients without SNI (most mail servers) get the mail host's certificate. When no real certificate can be had for an allowed host, a self-signed one keeps TLS available.
func (*Manager) SMTPCertificate ¶
func (m *Manager) SMTPCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
SMTPCertificate is GetCertificate for STARTTLS: mail servers send all kinds of names (or none), and a failed handshake makes some deliver in clear text, so any name it does not serve gets the mail host's certificate.