BUG/MEDIUM: acme: pass record names relative to the zone to libdns - #417
Open
bilhackmac wants to merge 1 commit into
Open
bilhackmac wants to merge 1 commit into
bilhackmac wants to merge 1 commit into
Conversation
The dns-01 solver builds the TXT record name from the full domain (`_acme-challenge.sub.example.com`) and hands it as-is to the libdns provider, together with the zone (`example.com.`). libdns expects record names to be relative to the zone. Providers that map the name directly onto a subdomain field, like OVH, end up creating `_acme-challenge.sub.example.com.example.com`, so the propagation check never succeeds and the challenge times out. Others, like Cloudflare, happen to work because their API normalizes a name that already ends with the zone. Use `libdns.RelativeName()` in both `Present()` and `CleanUp()` once the zone is known. The propagation check in `Wait()` builds its own absolute name and is not affected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
I've been setting up the native HAProxy ACME client with dns-01 and Data Plane API, using the OVH provider. The challenge never completed: the TXT record was created, but under
_acme-challenge.sub.example.com.example.cominstead of_acme-challenge.sub.example.com.Cause
makeRecord()builds the record name from the full domain andPresent()passes it as-is to the provider, alongside the zone (example.com.). libdns expects names relative to the zone (that's whatlibdns.RelativeName()/AbsoluteName()are for).libdns/ovh follows that contract literally and uses the name as the OVH
subDomain, hence the doubled name. I suspect this went unnoticed because some providers tolerate a FQDN there. libdns/cloudflare, for instance, goes throughlibdns.AbsoluteName(), and the Cloudflare API normalizes a name that already ends with the zone.Fix
Convert the name with
libdns.RelativeName()once the zone is known, in bothPresent()andCleanUp().Wait()builds its own absolute name for the propagation check, so it doesn't need to change.Testing
Built from v3.4.3 with this patch, OVH provider,
*.sub.example.comin zoneexample.com:Before the patch,
dig TXT _acme-challenge.sub.example.com.example.comreturned the challenge token.