mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 22:23:48 +03:00
httpcaddyfile: Add ocsp_interval global option (#4980)
This commit is contained in:
parent
3aabbc49a2
commit
b540f195b1
3 changed files with 11 additions and 0 deletions
|
@ -37,6 +37,7 @@ func init() {
|
||||||
RegisterGlobalOption("storage", parseOptStorage)
|
RegisterGlobalOption("storage", parseOptStorage)
|
||||||
RegisterGlobalOption("storage_clean_interval", parseOptDuration)
|
RegisterGlobalOption("storage_clean_interval", parseOptDuration)
|
||||||
RegisterGlobalOption("renew_interval", parseOptDuration)
|
RegisterGlobalOption("renew_interval", parseOptDuration)
|
||||||
|
RegisterGlobalOption("ocsp_interval", parseOptDuration)
|
||||||
RegisterGlobalOption("acme_ca", parseOptSingleString)
|
RegisterGlobalOption("acme_ca", parseOptSingleString)
|
||||||
RegisterGlobalOption("acme_ca_root", parseOptSingleString)
|
RegisterGlobalOption("acme_ca_root", parseOptSingleString)
|
||||||
RegisterGlobalOption("acme_dns", parseOptACMEDNS)
|
RegisterGlobalOption("acme_dns", parseOptACMEDNS)
|
||||||
|
|
|
@ -307,6 +307,14 @@ func (st ServerType) buildTLSApp(
|
||||||
tlsApp.Automation.RenewCheckInterval = renewCheckInterval
|
tlsApp.Automation.RenewCheckInterval = renewCheckInterval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the OCSP check interval if configured
|
||||||
|
if ocspCheckInterval, ok := options["ocsp_interval"].(caddy.Duration); ok {
|
||||||
|
if tlsApp.Automation == nil {
|
||||||
|
tlsApp.Automation = new(caddytls.AutomationConfig)
|
||||||
|
}
|
||||||
|
tlsApp.Automation.OCSPCheckInterval = ocspCheckInterval
|
||||||
|
}
|
||||||
|
|
||||||
// set whether OCSP stapling should be disabled for manually-managed certificates
|
// set whether OCSP stapling should be disabled for manually-managed certificates
|
||||||
if ocspConfig, ok := options["ocsp_stapling"].(certmagic.OCSPConfig); ok {
|
if ocspConfig, ok := options["ocsp_stapling"].(certmagic.OCSPConfig); ok {
|
||||||
tlsApp.DisableOCSPStapling = ocspConfig.DisableStapling
|
tlsApp.DisableOCSPStapling = ocspConfig.DisableStapling
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
}
|
}
|
||||||
storage_clean_interval 7d
|
storage_clean_interval 7d
|
||||||
renew_interval 1d
|
renew_interval 1d
|
||||||
|
ocsp_interval 2d
|
||||||
|
|
||||||
key_type ed25519
|
key_type ed25519
|
||||||
}
|
}
|
||||||
|
@ -83,6 +84,7 @@
|
||||||
},
|
},
|
||||||
"ask": "https://example.com"
|
"ask": "https://example.com"
|
||||||
},
|
},
|
||||||
|
"ocsp_interval": 172800000000000,
|
||||||
"renew_interval": 86400000000000,
|
"renew_interval": 86400000000000,
|
||||||
"storage_clean_interval": 604800000000000
|
"storage_clean_interval": 604800000000000
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue