mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 14:13:48 +03:00
reverseproxy: Add Caddyfile support for ClientCertificateAutomate
This commit is contained in:
parent
1dfb11486e
commit
4b10ae5ce6
1 changed files with 10 additions and 8 deletions
|
@ -619,15 +619,19 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||||
h.DialTimeout = caddy.Duration(dur)
|
h.DialTimeout = caddy.Duration(dur)
|
||||||
|
|
||||||
case "tls_client_auth":
|
case "tls_client_auth":
|
||||||
args := d.RemainingArgs()
|
|
||||||
if len(args) != 2 {
|
|
||||||
return d.ArgErr()
|
|
||||||
}
|
|
||||||
if h.TLS == nil {
|
if h.TLS == nil {
|
||||||
h.TLS = new(TLSConfig)
|
h.TLS = new(TLSConfig)
|
||||||
}
|
}
|
||||||
h.TLS.ClientCertificateFile = args[0]
|
args := d.RemainingArgs()
|
||||||
h.TLS.ClientCertificateKeyFile = args[1]
|
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":
|
case "tls":
|
||||||
if h.TLS == nil {
|
if h.TLS == nil {
|
||||||
|
@ -664,7 +668,6 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||||
if h.TLS == nil {
|
if h.TLS == nil {
|
||||||
h.TLS = new(TLSConfig)
|
h.TLS = new(TLSConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
h.TLS.RootCAPEMFiles = args
|
h.TLS.RootCAPEMFiles = args
|
||||||
|
|
||||||
case "tls_server_name":
|
case "tls_server_name":
|
||||||
|
@ -674,7 +677,6 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||||
if h.TLS == nil {
|
if h.TLS == nil {
|
||||||
h.TLS = new(TLSConfig)
|
h.TLS = new(TLSConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
h.TLS.ServerName = d.Val()
|
h.TLS.ServerName = d.Val()
|
||||||
|
|
||||||
case "keepalive":
|
case "keepalive":
|
||||||
|
|
Loading…
Reference in a new issue