acme-nosudo
acme-nosudo copied to clipboard
Spurious bad-nonce replies from letsencrypt, cause repeated script fail
It seems that letsencrypt is prone to spuriously replying with a "Bad Nonce" error such as:
{
"type": "urn:acme:error:badNonce",
"detail": "JWS has invalid anti-replay nonce qJFSreH91k9u1_1GBEpZk907cncjOI_HlZgiI2VNXoY",
"status": 400
}
Based on my own research into the Let's Encrypt issue, their approach to solving this is to simply resubmit the request with the nonce returned in the error.
The sign_csr.py script, unfortunately fails instead. Here is a trace:
Traceback (most recent call last):
File "letsencrypt-nosudo/sign_csr.py", line 446, in
The bad nonce's are happening on average 1 in 5 trys. Unfortunately the script does quite a few requests, each of which may return a Bad Nonce error. So, it is virtually impossible (at least for me at the moment) to get all of the way through the script successfully. When the script fails, I have to start all over at the beginning, instead of being able to save the progress so far, and just resume at the next step.
Is there a way to save the partial successful results, and just retry the latest failed request?
Can confirm this, it happened to me on the first attempt.
The workaround is as follows:
as soon as you start the python script, everything has to be accomplished within one minute or so (I guess the nonce has a 60 seconds time-to-live). If you are new to letsencrypt then first of all take your time and carefully read the instructions, then practice the steps without worrying about the timeout. Eventually you'll run into the badNonce error. Don't worry, you can repeat running the python script as often as you like until you feel confident doing all the command line inputs within a 60 secs timeframe.
I will revisit better ways to reduce nonce timeouts when ACME v2 lands and I update the script to support that.