Skip to content

Commit

Permalink
caddytls: Customize DNS resolvers for DNS challenge with Caddyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Aug 31, 2020
1 parent 724b74d commit 24f3478
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/caddytls/acmeissuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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())
}
Expand Down

0 comments on commit 24f3478

Please sign in to comment.