Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 15:30 UTC
httpcaddyfile: Add ocsp_interval global option (#4980)
Ben Burkert committed
Aug 24, 2022 at 19:22 UTC
b540f195b1bdf5ea8b869e43431a3f1d64810753
3 files changed
+11
caddyconfig/httpcaddyfile/options.go
+1
@@ -37,6 +37,7 @@ func init() {
37
RegisterGlobalOption("storage", parseOptStorage)
38
RegisterGlobalOption("storage_clean_interval", parseOptDuration)
39
RegisterGlobalOption("renew_interval", parseOptDuration)
40
+ RegisterGlobalOption("ocsp_interval", parseOptDuration)
41
RegisterGlobalOption("acme_ca", parseOptSingleString)
42
RegisterGlobalOption("acme_ca_root", parseOptSingleString)
43
RegisterGlobalOption("acme_dns", parseOptACMEDNS)
caddyconfig/httpcaddyfile/tlsapp.go
+8
@@ -307,6 +307,14 @@ func (st ServerType) buildTLSApp(
307
tlsApp.Automation.RenewCheckInterval = renewCheckInterval
308
}
309
310
+ // set the OCSP check interval if configured
311
+ if ocspCheckInterval, ok := options["ocsp_interval"].(caddy.Duration); ok {
312
+ if tlsApp.Automation == nil {
313
+ tlsApp.Automation = new(caddytls.AutomationConfig)
314
+ }
315
+ tlsApp.Automation.OCSPCheckInterval = ocspCheckInterval
316
+ }
317
+
318
// set whether OCSP stapling should be disabled for manually-managed certificates
319
if ocspConfig, ok := options["ocsp_stapling"].(certmagic.OCSPConfig); ok {
320
tlsApp.DisableOCSPStapling = ocspConfig.DisableStapling
caddytest/integration/caddyfile_adapt/global_options_acme.txt
+2
@@ -22,6 +22,7 @@
22
}
23
storage_clean_interval 7d
24
renew_interval 1d
25
+ ocsp_interval 2d
26
27
key_type ed25519
28
}
@@ -83,6 +84,7 @@
84
},
85
"ask": "https://example.com"
86
},
87
+ "ocsp_interval": 172800000000000,
88
"renew_interval": 86400000000000,
89
"storage_clean_interval": 604800000000000
90
}