Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoCertificateAvailable = errors.New("no certificate available") ErrCertificateManagerClosed = errors.New("certificate manager is closed") )
Functions ¶
This section is empty.
Types ¶
type CertificateManager ¶
type CertificateManager struct {
// contains filtered or unexported fields
}
CertificateManager represents a certificate manager that provides automatic access to certificates from Let's Encrypt and any other ACME-based CA... similar to golang.org/x/crypto/acme/autocert except that this package solves the ACME "dns-01" challenge (instead of "http-01") by using a tsdmg client to create the TXT records required to prove domain ownership.
func NewCertificateManager ¶
func (*CertificateManager) Close ¶
func (c *CertificateManager) Close() error
Close gracefully closes the CertificateManager.
func (*CertificateManager) GetCertificate ¶
func (c *CertificateManager) GetCertificate(hi *tls.ClientHelloInfo) (*tls.Certificate, error)
func (*CertificateManager) WaitForInitialCert ¶
func (c *CertificateManager) WaitForInitialCert(ctx context.Context) error
type Option ¶
type Option func(*config)
Option represents a configuration option for initializing a client.
func WithACMEAContact ¶
WithACMEAContact is a configuration option to configure contact details for the ACME account e.g.
func WithACMEAccountKey ¶
WithACMEAccountKey is a configuration option to configure an ACME account key. If this option is unset, a key will be generated at runtime.
func WithCertificateCache ¶
WithCertificateCache is a configuration option to configure certificate (and private key) caching. If this option is not set, the runtime will always attempt to fetch certificates from the acme proxy server on start-up, and will be unable to persist retrieved certiticates.
It is always a good idea to specify a cache strategy... Or the acme proxy will likely hit rate limits for the CN and SANS requested.
func WithLogger ¶
WithLogger is a configuration option to configure a logger. If this option is not set a log/slog logger is used with a JSON handler.