-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/crypto/acme: badNonce errors should be retried automatically #19703
Comments
@fastest963 we're running this patch in production, it fixed the issues well when we first deployed it on Monday, but ever since April 6th (coinciding with Let's Encrypt maintenance), we are seeing |
The feature LGTM. I'd submit the patch to Gerrit for core review. A test would be great. Also, curious about @marktheunissen's issue. Maybe need to retry more times? |
@marktheunissen I haven't seen the same problem. What could be happening is that there's still stored invalid nonces. I've updated my patch above in the summary to clear out any stored nonces after we get a @FiloSottile thanks for checking it out! I'll add a test and submit to Gerrit after I hear back from @marktheunissen. |
Thanks! Will give it a try on Monday. |
We now think it might be something to do with our usage of the lib, rather than a change in Boulder (Let's Encrypt) ... still looking into it. |
I created the following CL https://go-review.googlesource.com/c/40130/ |
After receiving a badNonce error, the call can be safely retried. Nonce errors can happen unexpectedly based on an unknown expiration date or server-side changes. Rather than force the caller handle these errors, retryPostJWS will keep retrying until success or a different error. According to the spec, the error returned should be "urn:ietf:params:acme:error:badNonce", but the error that Let's Encrypt returns is "urn:acme:error:badNonce" so we just check the suffix. Fixes golang/go#19703 Change-Id: Id15012dff91e51d28ed8bc54f13a6212186cb7df
CL https://golang.org/cl/40130 mentions this issue. |
After receiving a badNonce error, the call can be safely retried. Nonce errors can happen unexpectedly based on an unknown expiration date or server-side changes. Rather than force the caller handle these errors, retryPostJWS will keep retrying until success or a different error. According to the spec, the error returned should be "urn:ietf:params:acme:error:badNonce", but the error that Let's Encrypt returns is "urn:acme:error:badNonce" so we just check the suffix. Fixes golang/go#19703 Change-Id: Id15012dff91e51d28ed8bc54f13a6212186cb7df
After receiving a badNonce error, the call can be safely retried. Nonce errors can happen unexpectedly based on an unknown expiration date or server-side changes. Rather than force the caller handle these errors, retryPostJWS will keep retrying until success or a different error. According to the spec, the error returned should be "urn:ietf:params:acme:error:badNonce", but the error that Let's Encrypt returns is "urn:acme:error:badNonce" so we just check the suffix. Fixes golang/go#19703 Change-Id: Id15012dff91e51d28ed8bc54f13a6212186cb7df Reviewed-on: https://go-review.googlesource.com/40130 Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Vaghin <ddos@google.com>
After receiving a badNonce error, the call can be safely retried. Nonce errors can happen unexpectedly based on an unknown expiration date or server-side changes. Rather than force the caller handle these errors, retryPostJWS will keep retrying until success or a different error. According to the spec, the error returned should be "urn:ietf:params:acme:error:badNonce", but the error that Let's Encrypt returns is "urn:acme:error:badNonce" so we just check the suffix. Fixes golang/go#19703 Change-Id: Id15012dff91e51d28ed8bc54f13a6212186cb7df Reviewed-on: https://go-review.googlesource.com/40130 Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Vaghin <ddos@google.com>
After receiving a badNonce error, the call can be safely retried. Nonce errors can happen unexpectedly based on an unknown expiration date or server-side changes. Rather than force the caller handle these errors, retryPostJWS will keep retrying until success or a different error. According to the spec, the error returned should be "urn:ietf:params:acme:error:badNonce", but the error that Let's Encrypt returns is "urn:acme:error:badNonce" so we just check the suffix. Fixes golang/go#19703 Change-Id: Id15012dff91e51d28ed8bc54f13a6212186cb7df Reviewed-on: https://go-review.googlesource.com/40130 Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Vaghin <ddos@google.com>
After receiving a badNonce error, the call can be safely retried. Nonce errors can happen unexpectedly based on an unknown expiration date or server-side changes. Rather than force the caller handle these errors, retryPostJWS will keep retrying until success or a different error. According to the spec, the error returned should be "urn:ietf:params:acme:error:badNonce", but the error that Let's Encrypt returns is "urn:acme:error:badNonce" so we just check the suffix. Fixes golang/go#19703 Change-Id: Id15012dff91e51d28ed8bc54f13a6212186cb7df Reviewed-on: https://go-review.googlesource.com/40130 Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Vaghin <ddos@google.com>
After receiving a badNonce error, the call can be safely retried. Nonce errors can happen unexpectedly based on an unknown expiration date or server-side changes. Rather than force the caller handle these errors, retryPostJWS will keep retrying until success or a different error. According to the spec, the error returned should be "urn:ietf:params:acme:error:badNonce", but the error that Let's Encrypt returns is "urn:acme:error:badNonce" so we just check the suffix. Fixes golang/go#19703 Change-Id: Id15012dff91e51d28ed8bc54f13a6212186cb7df Reviewed-on: https://go-review.googlesource.com/40130 Run-TryBot: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Vaghin <ddos@google.com>
When a call to the Let's Encrypt server returns
urn:acme:error:badNonce
, it should be retried with the nonce returned with that error. Currently it's up to the caller to handle this and automatically retry, which can be tedious since you'd have to wrap or add code around every call to aacme.Client
method.The reason why you get this error is explained in certbot/certbot#2244 (comment):
I propose that the
postJWS
method in acme handle this and automatically retry once if abadNonce
error is returned, like what was done for certbot/certbot. It looks like all the calls that utilize nonces use that method. When quickly prototyping a solution, I ran into the issue thatpostJWS
just returns the response and relies on the caller to notice an error and callresponseError
. To make things easy, I had 4XX and 5XX errors automatically handled insidepostJWS
and then thebadNonce
error is checked in there.According to the spec, the error should be
urn:ietf:params:acme:error:badNonce
but the error that Let's Encrypt returns isurn:acme:error:badNonce
, I wasn't sure which is correct, so in my prototype I just looked for the suffix matching.Prototype patch: jameshartig/crypto@957374c
The text was updated successfully, but these errors were encountered: