Repository navigation
fix: remove DNS-01 challenge TXT records after enrollment - #32
Merged
Merged
Conversation
ProcessAuthorizations created challenge TXT records but nothing ever called DeleteRecordAsync, leaving orphaned _acme-challenge records in the DNS zone after every enrollment. Track created records and remove them in a finally block after order finalization (best effort, failures are logged and never fail the enrollment). Also fix Cloudflare deletion, which queried by the zone-relative name instead of the FQDN and removed only the first match. AB#111453
indrora
added a commit
that referenced
this pull request
Oct 27, 2026
* Release: 1.3.0 --------- Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io> * docs: make Let's Encrypt certificate instructions generic (#15) Removed specific root/intermediate names (ISRG Root X1, R3) that go stale when Let's Encrypt rotates their chain. Users are now directed to the official Let's Encrypt certificates page to identify the currently active root and intermediate certificates. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix: remove DNS-01 challenge TXT records after enrollment (#32) ProcessAuthorizations created challenge TXT records but nothing ever called DeleteRecordAsync, leaving orphaned _acme-challenge records in the DNS zone after every enrollment. Track created records and remove them in a finally block after order finalization (best effort, failures are logged and never fail the enrollment). Also fix Cloudflare deletion, which queried by the zone-relative name instead of the FQDN and removed only the first match. AB#111453 --------- Co-authored-by: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com> Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
DNS-01
_acme-challengeTXT records were never removed after certificate issuance, for any DNS provider.ProcessAuthorizationscalledCreateRecordAsync, but nothing in the plugin ever calledDeleteRecordAsync. Reported against Cloudflare, where records accumulate in the zone with every enrollment/renewal.Changes
finallyafter order finalization, so cleanup also runs when the enrollment fails. Cleanup is best effort: failures are logged as warnings and never change the enrollment result. Shared names (wildcard + base domain) are deleted once.DeleteRecordAsynclooked records up by the zone-relative name, but the Cloudflarenamefilter expects the FQDN, and it only deleted the first match. It now queries by FQDN and deletes all matching TXT records.Testing
release-1.3has no test project, and the suite ontests/unit-test-coveragetargets the 2.0 code.Notes
IDnsProvider.DeleteRecordAsyncimplementations were never exercised before this change and have not been reviewed.AB#111453