Documentation
¶
Index ¶
- func LoadOrGenerateFallbackCert(certsDir string) (tls.Certificate, error)
- func ServeTLSSelfSigned(ctx context.Context, log *slog.Logger, h http.Handler) error
- func ServeTLSWithController(ctx context.Context, log *slog.Logger, certProvider CertificateProvider, ...) error
- type CertificateProvider
- type HTTPChallengeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadOrGenerateFallbackCert ¶ added in v0.6.0
func LoadOrGenerateFallbackCert(certsDir string) (tls.Certificate, error)
loadOrGenerateFallbackCert loads a cached fallback certificate from disk, or generates a new one if it doesn't exist or is expiring soon. This ensures users who accept the browser warning don't have to re-accept on every server restart.
func ServeTLSSelfSigned ¶ added in v0.3.0
ServeTLSSelfSigned serves HTTPS using a self-signed certificate. This is intended for development and testing only.
func ServeTLSWithController ¶
func ServeTLSWithController(ctx context.Context, log *slog.Logger, certProvider CertificateProvider, h http.Handler) error
ServeTLSWithController serves HTTPS using certificates provided by a controller. If the certProvider also implements HTTPChallengeProvider, the port-80 handler wraps the redirect handler to serve ACME HTTP-01 challenges.
Types ¶
type CertificateProvider ¶
type CertificateProvider interface {
GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
}
CertificateProvider provides certificates via GetCertificate callback
Click to show internal directories.
Click to hide internal directories.