diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-05-01 10:41:08 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-05-01 10:41:08 -0600 |
commit | a77bd1d8877fbbc8828e464a8c600e5a8aeb9aee (patch) | |
tree | af38a8e19f4707746f7530fa3dfa67dc4e00275b /caddyconfig/httpcaddyfile | |
parent | bca610fbde82c4b45526dd526d7ddfa6e3bdac70 (diff) |
httpcaddyfile: Update tls parsing for DNS providers
Diffstat (limited to 'caddyconfig/httpcaddyfile')
-rw-r--r-- | caddyconfig/httpcaddyfile/builtins.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/caddyconfig/httpcaddyfile/builtins.go b/caddyconfig/httpcaddyfile/builtins.go index 8137ce2..b5a9341 100644 --- a/caddyconfig/httpcaddyfile/builtins.go +++ b/caddyconfig/httpcaddyfile/builtins.go @@ -205,19 +205,26 @@ func parseTLS(h Helper) ([]ConfigValue, error) { if !h.Next() { return nil, h.ArgErr() } + provName := h.Val() if acmeIssuer == nil { acmeIssuer = new(caddytls.ACMEIssuer) } - provName := h.Val() if acmeIssuer.Challenges == nil { acmeIssuer.Challenges = new(caddytls.ChallengesConfig) acmeIssuer.Challenges.DNS = new(caddytls.DNSChallengeConfig) } - dnsProvModule, err := caddy.GetModule("tls.dns." + provName) + dnsProvModule, err := caddy.GetModule("dns.providers." + provName) if err != nil { return nil, h.Errf("getting DNS provider module named '%s': %v", provName, err) } - acmeIssuer.Challenges.DNS.ProviderRaw = caddyconfig.JSONModuleObject(dnsProvModule.New(), "name", provName, h.warnings) + dnsProvModuleInstance := dnsProvModule.New() + if unm, ok := dnsProvModuleInstance.(caddyfile.Unmarshaler); ok { + err = unm.UnmarshalCaddyfile(h.NewFromNextSegment()) + if err != nil { + return nil, err + } + } + acmeIssuer.Challenges.DNS.ProviderRaw = caddyconfig.JSONModuleObject(dnsProvModuleInstance, "name", provName, h.warnings) case "ca_root": arg := h.RemainingArgs() |