summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-09-09 10:21:59 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-09-09 10:21:59 -0600
commit9859ab8148435e64accd8d66e67db29fb5cbc9e7 (patch)
treed4b1c1cd52457466aa3623dc78f1f06cdf30cee3
parent00e6b77fe4eb4a692649970bf1724de22b15bba9 (diff)
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
-rw-r--r--modules/caddytls/acmeissuer.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go
index e0f656a..b73b34f 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())