Skip to content

Stop hammering LetsEncrypt 100 times for badNonce #287

@anthonyryan1

Description

@anthonyryan1

Relevant lines:

It's extremely rude of acme-tiny to abuse LetsEncrypt like this, and the code in this repository acts like this is a bug in LetsEncrypt when it's actually a bug in our code.

And we aren't even polite enough to have a sleep between retries, we're just hammering their server repeatedly, expecting a different result.

The cause of the badNonce error is that LetsEncrypt runs a large number of servers to deal with the load. If we request an nonce from a server, then try to use it on a different server, with a different connection. The other server won't recognize the nonce. Admittedly I'm not sure if this is a replication delay, or if LetsEncrypt deliberately doesn't sync nonce tokens between servers.

I've personally verified that changing acme tiny to use a single TLS connection for all requests with: persistent_connection = http.client.HTTPSConnection(...) then sending all requests on the same connection (meaning they route consistently to the same LetsEncrypt server) has meant I'm no longer seeing badNonce errors. I don't even have retry code for it anymore, just a fatal exception if it's hit even once (which has yet to happen).

I would be happy to send a patch, but I have no interest in trying to fit it into the line count.

Respectfully, I feel like the line count goal for this project has fallen to Goodhart's law. What used to be a measurement of easy-to-read code, has become the opposite with developers now making individual lines much less readable, desperately trying to stay under the arbitrary line count limit.

So for the moment, I'm just filing this as an issue explaining exactly what's causing badNonce errors and how to fix it. The rest is left as an exercise for someone who enjoys playing code golf to stay under the line count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions