Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS Verification Configurable Timeout and Retry Interval #6244

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

jpbion
Copy link

@jpbion jpbion commented Feb 24, 2025

MOTIVE: At least one Domain Name Registrar (DNR) has increased the amount of time between changes you make to your zone file (via API) and their publication to the Internet. This causes DNS verification (via TXT record creation) to time out, as the current timeout is only 20 minutes long, and it retries every 10 seconds. Both the rapid retry rate and the short timeout before failure cause acme.sh to no longer work for verifying domain ownership with such DNRs. Using --dnssleep is also not optimal. It has a downside of not allowing for the DNS propagation to end up working more quickly than the sleep time, and producing the certificate sooner. By allowing a configurable retry and timeout interval, one can both be kind to the DNR (say, by trying it only once every 15-20 minutes), and 'succeeding sooner' on a successful try. Further, --dnssleep disables public DNS checks, which is suboptimal if the issue is simply slow propagation.

DISCUSSION: An ideal solution would extend the capabilities of the DNR provider scripts to specify what default domain DNS verification timeout and verification retry intervals should be for the DNR in question,so the user does not need to specify them. Then, the user could override them with the two command line options provided here. What I provide in this pull request is NOT this ideal solution, but rather just the two command line options, as getting agreement to extend what DNS API scripts need to provide would take longer, and these options are needed now.

DESIGN CHOICE TRADEOFF:

DOWNSIDE: each user of a slow publisher needs to specify these new parameters on the .acme.sh command line: if they wish to customize away from the default DNS verification and retry timers, just specify --dns-validate-interval and --dns-validate-timeout and give each of them values. For example, I use an interval of 1200 seconds for interval and 14400 for timeout. This works wonderfully for me. If the per-DNR API option were provided, users would be less likely to need these.

UPSIDE: These command line options are still needed to allow a user to work around slow propagation by their DNR, even if DNR-specific default DNS validation timer values were provided in a DNR's API script, because the DNR will often change propagation behavior without updating acme.sh API scripts. Not having these command line options would require users to modify the acme.sh code.

@jpbion
Copy link
Author

jpbion commented Feb 27, 2025

Hi - is it possible for someone to approve the workflows - or at least tell me what steps if any I need to do to get them approved? Thanks!

@jpbion
Copy link
Author

jpbion commented Feb 28, 2025

I’ve committed a change to make shfmt pass - the error it reported was whitespace after a “fi”. I’ve removed the whitespace and committed the one line change. If the workflow could get re-run, that’d be great - thanks!

@@ -4200,7 +4200,24 @@ __purge_txt() {
_check_dns_entries() {
_success_txt=","
_end_time="$(_time)"
_end_time="$(_math "$_end_time" + 1200)" #let's check no more than 20 minutes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make _dnstimeout and _dnsinterval as parameters of _check_dns_entries() function.

acme.sh Outdated
# interval (10 seconds), unless configured at script invocation to be
# something else.
_dnstimeout=1200 #default timeout is 20 minutes
if [ -n "$Le_DNSValidateTimeout" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this _savedomainconf to the _issue() function.
The save operation should only happen in _issue() method

…meters to _check_dns_entries per Neilpang code review request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants