Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 12, 13:15 UTC
chore: add warn logs when using deprecated fields (#6276)
Mohammed Al Sahaf committed
Apr 27, 2024 at 22:51 UTC
87c7127c286982fb302bf88cc1689fafacba12fb
3 files changed
+4
-2
caddyconfig/httpcaddyfile/builtins.go
+1
-2
@@ -69,8 +69,7 @@ func parseBind(h Helper) ([]ConfigValue, error) {
69
// curves <curves...>
70
// client_auth {
71
// mode [request|require|verify_if_given|require_and_verify]
72
-// trusted_ca_cert <base64_der>
73
-// trusted_ca_cert_file <filename>
72
+// trust_pool <module_name> [...]
73
// trusted_leaf_cert <base64_der>
74
// trusted_leaf_cert_file <filename>
75
// }
modules/caddyhttp/reverseproxy/caddyfile.go
+1
@@ -1112,6 +1112,7 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
1112
h.TLS.HandshakeTimeout = caddy.Duration(dur)
1113
1114
case "tls_trusted_ca_certs":
1115
+ caddy.Log().Warn("The 'tls_trusted_ca_certs' field is deprecated. Use the 'tls_trust_pool' field instead.")
1116
args := d.RemainingArgs()
1117
if len(args) == 0 {
1118
return d.ArgErr()
modules/caddytls/connpolicy.go
+2
@@ -443,6 +443,7 @@ func (ca *ClientAuthentication) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
443
return d.ArgErr()
444
}
445
case "trusted_ca_cert":
446
+ caddy.Log().Warn("The 'trusted_ca_cert' field is deprecated. Use the 'trust_pool' field instead.")
447
if len(ca.CARaw) != 0 {
448
return d.Err("cannot specify both 'trust_pool' and 'trusted_ca_cert' or 'trusted_ca_cert_file'")
449
}
@@ -456,6 +457,7 @@ func (ca *ClientAuthentication) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
457
}
458
ca.TrustedLeafCerts = append(ca.TrustedLeafCerts, d.Val())
459
case "trusted_ca_cert_file":
460
+ caddy.Log().Warn("The 'trusted_ca_cert_file' field is deprecated. Use the 'trust_pool' field instead.")
461
if len(ca.CARaw) != 0 {
462
return d.Err("cannot specify both 'trust_pool' and 'trusted_ca_cert' or 'trusted_ca_cert_file'")
463
}