summaryrefslogtreecommitdiff
path: root/modules/caddytls
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-08-31 13:23:26 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-08-31 13:23:26 -0600
commit24f34780b61fc82df6507cf95535c3dfc9f78058 (patch)
tree157656dfe467f30e79b3ef4c81451efaaf3db19c /modules/caddytls
parent724b74d98144e502d4cd7b2a4b1c2309e7536d4f (diff)
caddytls: Customize DNS resolvers for DNS challenge with Caddyfile
Diffstat (limited to 'modules/caddytls')
-rw-r--r--modules/caddytls/acmeissuer.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go
index 0797435..e413156 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 <port>
// eab <key_id> <mac_key>
// trusted_roots <pem_files...>
+// resolvers <dns_servers...>
// }
//
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())
}