diff options
author | Matthew Holt <[email protected]> | 2020-06-08 10:30:26 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2020-06-08 10:30:26 -0600 |
commit | 4b10ae5ce6c930b5acd46cb5c569481f349e336c (patch) | |
tree | d4f67ef8d70ae864f4e8fb3d9d842f66b37fac3c /modules | |
parent | 1dfb11486eacc32af1003242023ddc4544823a31 (diff) | |
download | caddy-4b10ae5ce6c930b5acd46cb5c569481f349e336c.tar.gz caddy-4b10ae5ce6c930b5acd46cb5c569481f349e336c.zip |
reverseproxy: Add Caddyfile support for ClientCertificateAutomate
Diffstat (limited to 'modules')
-rw-r--r-- | modules/caddyhttp/reverseproxy/caddyfile.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go index 47896a7d5..4ffedf227 100644 --- a/modules/caddyhttp/reverseproxy/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/caddyfile.go @@ -619,15 +619,19 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { h.DialTimeout = caddy.Duration(dur) case "tls_client_auth": - args := d.RemainingArgs() - if len(args) != 2 { - return d.ArgErr() - } if h.TLS == nil { h.TLS = new(TLSConfig) } - h.TLS.ClientCertificateFile = args[0] - h.TLS.ClientCertificateKeyFile = args[1] + args := d.RemainingArgs() + switch len(args) { + case 1: + h.TLS.ClientCertificateAutomate = args[0] + case 2: + h.TLS.ClientCertificateFile = args[0] + h.TLS.ClientCertificateKeyFile = args[1] + default: + return d.ArgErr() + } case "tls": if h.TLS == nil { @@ -664,7 +668,6 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { if h.TLS == nil { h.TLS = new(TLSConfig) } - h.TLS.RootCAPEMFiles = args case "tls_server_name": @@ -674,7 +677,6 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { if h.TLS == nil { h.TLS = new(TLSConfig) } - h.TLS.ServerName = d.Val() case "keepalive": |