From 0d7ee5e750a87fa8d7c6ad59ce26054b7bb5df1f Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sat, 17 Sep 2022 20:04:47 +0200 Subject: [PATCH] luadns: fix cname support (#1717) --- acme/api/internal/nonces/nonce_manager_test.go | 2 +- acme/api/internal/secure/jws_test.go | 2 +- providers/dns/luadns/luadns.go | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/acme/api/internal/nonces/nonce_manager_test.go b/acme/api/internal/nonces/nonce_manager_test.go index 905864ff..a172a0b6 100644 --- a/acme/api/internal/nonces/nonce_manager_test.go +++ b/acme/api/internal/nonces/nonce_manager_test.go @@ -49,7 +49,7 @@ func TestNotHoldingLockWhileMakingHTTPRequests(t *testing.T) { }() select { case <-resultCh: - case <-time.After(400 * time.Millisecond): + case <-time.After(500 * time.Millisecond): t.Fatal("JWS is probably holding a lock while making HTTP request") } } diff --git a/acme/api/internal/secure/jws_test.go b/acme/api/internal/secure/jws_test.go index c09a8433..2e625f24 100644 --- a/acme/api/internal/secure/jws_test.go +++ b/acme/api/internal/secure/jws_test.go @@ -50,7 +50,7 @@ func TestNotHoldingLockWhileMakingHTTPRequests(t *testing.T) { }() select { case <-resultCh: - case <-time.After(400 * time.Millisecond): + case <-time.After(500 * time.Millisecond): t.Fatal("JWS is probably holding a lock while making HTTP request") } } diff --git a/providers/dns/luadns/luadns.go b/providers/dns/luadns/luadns.go index 180a42c5..e17d026c 100644 --- a/providers/dns/luadns/luadns.go +++ b/providers/dns/luadns/luadns.go @@ -119,7 +119,12 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { return fmt.Errorf("luadns: failed to get zones: %w", err) } - zone := findZone(zones, domain) + authZone, err := dns01.FindZoneByFqdn(fqdn) + if err != nil { + return fmt.Errorf("luadns: failed to find zone: %w", err) + } + + zone := findZone(zones, authZone) if zone == nil { return fmt.Errorf("luadns: no matching zone found for domain %s", domain) }