fix: precheck function.

This commit is contained in:
Ludovic Fernandez 2020-09-23 12:24:03 +02:00 committed by GitHub
parent f59bf16e82
commit ef08e8b8a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,15 +265,15 @@ func (p *Provider) getClient() (*lego.Client, error) {
err = client.Challenge.SetDNS01Provider(provider,
dns01.CondOption(len(p.DNSChallenge.Resolvers) > 0, dns01.AddRecursiveNameservers(p.DNSChallenge.Resolvers)),
dns01.WrapPreCheck(func(domain, fqdn, value string, check dns01.PreCheckFunc) (bool, error) {
if p.DNSChallenge.DisablePropagationCheck {
return true, nil
}
if p.DNSChallenge.DelayBeforeCheck > 0 {
logger.Debugf("Delaying %d rather than validating DNS propagation now.", p.DNSChallenge.DelayBeforeCheck)
time.Sleep(time.Duration(p.DNSChallenge.DelayBeforeCheck))
}
if p.DNSChallenge.DisablePropagationCheck {
return true, nil
}
return check(fqdn, value)
}),
)