Browse Source

tls: Make cert and OCSP check intervals configurable

This enables use of ACME CAs that issue shorter-lived certs
master
Matthew Holt 6 years ago
parent
commit
7b33c8db31
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 8
      modules/caddytls/tls.go

8
modules/caddytls/tls.go

@ -66,6 +66,8 @@ func (t *TLS) Provision(ctx caddy.Context) error {
GetConfigForCert: func(cert certmagic.Certificate) (certmagic.Config, error) { GetConfigForCert: func(cert certmagic.Certificate) (certmagic.Config, error) {
return t.getConfigForName(cert.Names[0]) return t.getConfigForName(cert.Names[0])
}, },
OCSPCheckInterval: time.Duration(t.Automation.OCSPCheckInterval),
RenewCheckInterval: time.Duration(t.Automation.RenewCheckInterval),
}) })
// automation/management policies // automation/management policies
@ -286,8 +288,10 @@ type Certificate struct {
// AutomationConfig designates configuration for the // AutomationConfig designates configuration for the
// construction and use of ACME clients. // construction and use of ACME clients.
type AutomationConfig struct { type AutomationConfig struct {
Policies []AutomationPolicy `json:"policies,omitempty"` Policies []AutomationPolicy `json:"policies,omitempty"`
OnDemand *OnDemandConfig `json:"on_demand,omitempty"` OnDemand *OnDemandConfig `json:"on_demand,omitempty"`
OCSPCheckInterval caddy.Duration `json:"ocsp_interval,omitempty"`
RenewCheckInterval caddy.Duration `json:"renew_interval,omitempty"`
} }
// AutomationPolicy designates the policy for automating the // AutomationPolicy designates the policy for automating the

Loading…
Cancel
Save