Closed ggalmazor closed 7 months ago
I believe we're seeing the same errors here too.
I won't both to repeat much since @ggalmazor has already done a great job digging in above (thanks, @ggalmazor!). For added clarity, here are the exceptions being seen here:
Acme::Client::Error::Malformed: JWS header parameter 'url' incorrect. Expected "https://acme-v02.api.letsencrypt.org/acme/order/xxxxx/yyyyy" got "https://acme-v02.api.letsencrypt.org/directory" (Acme::Client::Error::Malformed)
This is the same as mentioned in the repro example above. This is happening with different stacktraces, again consistent with the note above that it can come from multiple calls.
Acme::Client::Error::BadNonce: JWS has an invalid anti-replay nonce: "abcdefg..." (Acme::Client::Error::BadNonce)
Reverting to 2.0.15 resolved the issue (even on in-progress renewals that picked up from where they errored before, so it seems to be an in-memory thing, and not something with the original data).
Sorry about the inconvenience. I'm also unsure what could cause the problem.
I will have time to investigate later this week. Thanks for reporting.
Should be fixed in the 2.0.17 release. Let me know if you are still experiencing any issues.
I just confirmed that the issue doesn't reproduce with 2.0.17 ✅
Thanks, @unixcharles!
We have observed this issue with the update from 2.0.15 to 2.0.16
This code reproduces the issue and provides insight into the requirement to have the directory fetched for any other query to succeed:
This code targets the
.account
query, but we've seen the same behavior with multiple other calls.We haven't been able to pinpoint the exact cause in the library's code, but it sounds like the
.account
call is triggering a call to fetch the directory, and the Faradayenv
for the original query is being reused for it, which messes up the JWK signature.We are unsure how this behavior relates to the changes introduced in 2.0.16. However, the fact that in 2.0.15, fetching the directory would use a fresh
Acme::Client::HTTPClient
might be related and support the theory of the messed up Faradayenv
and wrong JWK signatures.