mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
[PR #262] [CLOSED] Retry invalid challenge responses, limit retries to 5. #775
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dehydrated-io/dehydrated/pull/262
Author: @extremeshok
Created: 8/22/2016
Status: ❌ Closed
Base:
master← Head:retry📝 Commits (2)
75f49bcRetry invalid challenge responses, set number of retries to NUMBER167f4abRetry invalid challenge responses, limit retries to 5.📊 Changes
2 files changed (+93 additions, -10 deletions)
View changed files
📝
README.md(+1 -0)📝
letsencrypt.sh(+92 -10)📄 Description
Coded to your coding standards, shellchecked
This will allow for the challenge to be retied for upto 5 times when it fails (returns invalid)
Allot of our servers are via cdn/load-balancers and they do not always sync quick enough, so will fail the first X attempts.
This also allows your script to have resiliency with bad connections/timeouts.
letsencrypt.sh --cron --force --retry
Update to pull : https://github.com/lukas2511/letsencrypt.sh/pull/261
Retries reduce the load.
Here is the specific use case:
All 1000+ servers/vm's are managed/setup by idempotent configuration management. Spanning multiple data centers and countries.
We run a single node aka ssl.domain.com which is responsible for all ssl deployments for all the servers. ie. All "/.well-known/acme-challenge/" http requests from all the 1000+ servers are proxied to the ssl.domain.com server.
Under real world situations on production servers there are timeouts for the length the proxy request can take. Letsencrypt also has timeouts for the validation response. So fact is they can and will fail to validate because they timed out.
Letsencrypt does and will rate limit the number for validation attempts for a domain, so it provides no more load than the current script. Also if you look at the code, I specifically slow down the retries by adding a random 1-10 second pause between each retry.
I can understand your issue with someone setting 99999 retries, but this is virtually no different to them running the script 99999 times in a loop until the certificate has generated. The major difference is the retries will have a far lower impact on the lets encrypt servers.
Currently: If you are creating a certificate with 20 sub-domains and only one of the 20 sub-domains fails (ie number 19) validation, you are forced to rerun the script and re-validate all the sub-domains which were already validated. Thus you increased the load 18 more times.
With my retries only the failed validation will be retried, thus you only have 1 extra validation.
If you are concerned with the user setting a limit of 99999, I have limited the retries to 5.
In real world production all are verified by the 3rd attempt.
As to the proposed add a hook script, there is no place in the code for a hook after the json verification has been generated and before the verification has been validated.
Not to mention the limitation with the hook scripts as they cant do retries for a timeout.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.