diff --git a/acme/dns_challenge.go b/acme/dns_challenge.go index b5c59ca4..c5fd354a 100644 --- a/acme/dns_challenge.go +++ b/acme/dns_challenge.go @@ -17,7 +17,9 @@ import ( type preCheckDNSFunc func(fqdn, value string) (bool, error) var ( - preCheckDNS preCheckDNSFunc = checkDNSPropagation + // PreCheckDNS checks DNS propagation before notifying ACME that + // the DNS challenge is ready. + PreCheckDNS preCheckDNSFunc = checkDNSPropagation fqdnToZone = map[string]string{} ) @@ -84,7 +86,7 @@ func (s *dnsChallenge) Solve(chlng challenge, domain string) error { } err = WaitFor(timeout, interval, func() (bool, error) { - return preCheckDNS(fqdn, value) + return PreCheckDNS(fqdn, value) }) if err != nil { return err diff --git a/acme/dns_challenge_test.go b/acme/dns_challenge_test.go index 40101353..6e448854 100644 --- a/acme/dns_challenge_test.go +++ b/acme/dns_challenge_test.go @@ -86,7 +86,7 @@ var checkAuthoritativeNssTestsErr = []struct { } func TestDNSValidServerResponse(t *testing.T) { - preCheckDNS = func(fqdn, value string) (bool, error) { + PreCheckDNS = func(fqdn, value string) (bool, error) { return true, nil } privKey, _ := rsa.GenerateKey(rand.Reader, 512) @@ -114,7 +114,7 @@ func TestDNSValidServerResponse(t *testing.T) { } func TestPreCheckDNS(t *testing.T) { - ok, err := preCheckDNS("acme-staging.api.letsencrypt.org", "fe01=") + ok, err := PreCheckDNS("acme-staging.api.letsencrypt.org", "fe01=") if err != nil || !ok { t.Errorf("preCheckDNS failed for acme-staging.api.letsencrypt.org") }