From 9859ab8148435e64accd8d66e67db29fb5cbc9e7 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 9 Sep 2020 10:21:59 -0600 Subject: [PATCH] caddytls: Fix resolvers option of acme issuer (Caddyfile) Reported in: https://caddy.community/t/dns-challenge-with-namecheap-and-split-horizon-dns/9611/17?u=matt --- modules/caddytls/acmeissuer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go index e0f656a8..b73b34ff 100644 --- a/modules/caddytls/acmeissuer.go +++ b/modules/caddytls/acmeissuer.go @@ -345,9 +345,6 @@ func (iss *ACMEIssuer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { iss.Challenges.DNS.ProviderRaw = caddyconfig.JSONModuleObject(dnsProvModuleInstance, "name", provName, nil) case "resolvers": - if !d.NextArg() { - return d.ArgErr() - } if iss.Challenges == nil { iss.Challenges = new(ChallengesConfig) } @@ -355,6 +352,9 @@ func (iss *ACMEIssuer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { iss.Challenges.DNS = new(DNSChallengeConfig) } iss.Challenges.DNS.Resolvers = d.RemainingArgs() + if len(iss.Challenges.DNS.Resolvers) == 0 { + return d.ArgErr() + } default: return d.Errf("unrecognized ACME issuer property: %s", d.Val())