From 24f34780b61fc82df6507cf95535c3dfc9f78058 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 31 Aug 2020 13:23:26 -0600 Subject: [PATCH] caddytls: Customize DNS resolvers for DNS challenge with Caddyfile --- modules/caddytls/acmeissuer.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go index 07974359493..e413156bd17 100644 --- a/modules/caddytls/acmeissuer.go +++ b/modules/caddytls/acmeissuer.go @@ -220,6 +220,7 @@ func (iss *ACMEIssuer) GetACMEIssuer() *ACMEIssuer { return iss } // alt_tlsalpn_port // eab // trusted_roots +// resolvers // } // func (iss *ACMEIssuer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { @@ -317,6 +318,18 @@ func (iss *ACMEIssuer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { case "trusted_roots": iss.TrustedRootsPEMFiles = d.RemainingArgs() + case "resolvers": + if !d.NextArg() { + return d.ArgErr() + } + if iss.Challenges == nil { + iss.Challenges = new(ChallengesConfig) + } + if iss.Challenges.DNS == nil { + iss.Challenges.DNS = new(DNSChallengeConfig) + } + iss.Challenges.DNS.Resolvers = d.RemainingArgs() + default: return d.Errf("unrecognized ACME issuer property: %s", d.Val()) }