mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
caddytls: Remove shim code supporting deprecated lego-dns (#6231)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
26748d06b4
commit
3609a4af75
1 changed files with 9 additions and 22 deletions
|
@ -28,7 +28,6 @@ import (
|
||||||
|
|
||||||
"github.com/caddyserver/certmagic"
|
"github.com/caddyserver/certmagic"
|
||||||
"github.com/caddyserver/zerossl"
|
"github.com/caddyserver/zerossl"
|
||||||
"github.com/mholt/acmez/v2"
|
|
||||||
"github.com/mholt/acmez/v2/acme"
|
"github.com/mholt/acmez/v2/acme"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
|
@ -135,27 +134,15 @@ func (iss *ACMEIssuer) Provision(ctx caddy.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("loading DNS provider module: %v", err)
|
return fmt.Errorf("loading DNS provider module: %v", err)
|
||||||
}
|
}
|
||||||
|
iss.Challenges.DNS.solver = &certmagic.DNS01Solver{
|
||||||
if deprecatedProvider, ok := val.(acmez.Solver); ok {
|
DNSManager: certmagic.DNSManager{
|
||||||
// TODO: For a temporary amount of time, we are allowing the use of DNS
|
DNSProvider: val.(certmagic.DNSProvider),
|
||||||
// providers from go-acme/lego since there are so many providers implemented
|
TTL: time.Duration(iss.Challenges.DNS.TTL),
|
||||||
// using that API -- they are adapted as an all-in-one Caddy module in this
|
PropagationDelay: time.Duration(iss.Challenges.DNS.PropagationDelay),
|
||||||
// repository: https://github.com/caddy-dns/lego-deprecated - the module is a
|
PropagationTimeout: time.Duration(iss.Challenges.DNS.PropagationTimeout),
|
||||||
// acmez.Solver type, so we use it directly. The user must set environment
|
Resolvers: iss.Challenges.DNS.Resolvers,
|
||||||
// variables to configure it. Remove this shim once a sufficient number of
|
OverrideDomain: iss.Challenges.DNS.OverrideDomain,
|
||||||
// DNS providers are implemented for the libdns APIs instead.
|
},
|
||||||
iss.Challenges.DNS.solver = deprecatedProvider
|
|
||||||
} else {
|
|
||||||
iss.Challenges.DNS.solver = &certmagic.DNS01Solver{
|
|
||||||
DNSManager: certmagic.DNSManager{
|
|
||||||
DNSProvider: val.(certmagic.DNSProvider),
|
|
||||||
TTL: time.Duration(iss.Challenges.DNS.TTL),
|
|
||||||
PropagationDelay: time.Duration(iss.Challenges.DNS.PropagationDelay),
|
|
||||||
PropagationTimeout: time.Duration(iss.Challenges.DNS.PropagationTimeout),
|
|
||||||
Resolvers: iss.Challenges.DNS.Resolvers,
|
|
||||||
OverrideDomain: iss.Challenges.DNS.OverrideDomain,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue