Documentation
¶
Overview ¶
Package certfallback finds and replaces the untrusted local-issuer certificate Caddy stores for a domain when a public CA could not issue one.
Index ¶
- func Drop(ctx context.Context, s Store, domain string) (int, error)
- func Held(ctx context.Context, s Store) (map[string][]string, error)
- func IsLocalIssuerCert(key string, cert *x509.Certificate) bool
- func ResolvesHere(ctx context.Context, domain string, serverIPs []string) bool
- type Retrier
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Drop ¶
Drop deletes only the local-issuer storage directories held for domain and returns how many it removed; a public-CA certificate is never touched.
func Held ¶
Held maps each lowercase domain to the storage directories holding a local-issuer certificate for it. Public-CA certificates are never listed.
func IsLocalIssuerCert ¶
func IsLocalIssuerCert(key string, cert *x509.Certificate) bool
IsLocalIssuerCert reports whether a stored certificate came from Caddy's internal CA, by its storage issuer segment or its issuer name.
Types ¶
type Retrier ¶
type Retrier struct {
Store Store
Candidates func(ctx context.Context) []string // ACME-owned domains only
Resolves func(ctx context.Context, domain string) bool
Interval func(ctx context.Context) time.Duration
MaxRetries func(ctx context.Context) int
Audit func(ctx context.Context, domain, detail string)
Nudge func()
Logger *slog.Logger
// contains filtered or unexported fields
}
Retrier periodically drops the fallback certificate of domains that now resolve to this server, so certmagic requests a public certificate again.
type Store ¶
type Store interface {
ListCertStorageKeys(ctx context.Context, prefix string, recursive bool) ([]string, error)
GetCertStorageValue(ctx context.Context, key string) (*store.CertStorageValue, error)
DeleteCertStorageValue(ctx context.Context, key string) error
}
Store is the cert storage surface; *store.DB satisfies it.