summaryrefslogtreecommitdiff
path: root/modules/caddytls/acmeissuer.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-05-02 17:23:36 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-05-02 17:23:36 -0600
commit8e4266106034819fa0f4be8f0efbd628eb3e1634 (patch)
treece92801fb98aaa3ff0bd16575fded67b9fbfcb78 /modules/caddytls/acmeissuer.go
parent86a4f2c9f4e7f85f2d59e2f1713aacf98ab8bc1a (diff)
caddytls: Finish upgrading to libdns DNS providers for ACME challenges
Until we finish the migration to the new acme library, we have to bring the solver type in-house. It's small and temporary.
Diffstat (limited to 'modules/caddytls/acmeissuer.go')
-rw-r--r--modules/caddytls/acmeissuer.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go
index dcdfc13..4295cda 100644
--- a/modules/caddytls/acmeissuer.go
+++ b/modules/caddytls/acmeissuer.go
@@ -91,7 +91,21 @@ func (m *ACMEIssuer) Provision(ctx caddy.Context) error {
if err != nil {
return fmt.Errorf("loading DNS provider module: %v", err)
}
- m.Challenges.DNS.provider = val.(challenge.Provider)
+ // TODO: For a temporary amount of time, we are allowing the use of
+ // DNS providers from go-acme/lego since there are so many implemented
+ // for it -- they are adapted as Caddy modules in this repository:
+ // https://github.com/caddy-dns/lego-deprecated - that module is
+ // a challenge.Provider value, so we use it directly. The user must set
+ // environment variables to configure it. Remove this shim once a sufficient
+ // number of DNS providers are implemented for the libdns APIs instead.
+ if grandfatheredProvider, ok := val.(challenge.Provider); ok {
+ m.Challenges.DNS.provider = grandfatheredProvider
+ } else {
+ m.Challenges.DNS.provider = &solver{
+ recordManager: val.(recordManager),
+ TTL: time.Duration(m.Challenges.DNS.TTL),
+ }
+ }
}
// add any custom CAs to trust store