ebekker / ACMESharp

An ACME client library and PowerShell client for the .NET platform (Let's Encrypt)
https://pkisharp.github.io/ACMESharp-docs/
1.21k stars 185 forks source link

Retry transient errors #354

Open ohadschn opened 5 years ago

ohadschn commented 5 years ago

I recently encountered the following callstack:

ACMESharp.AcmeClient+AcmeWebException: Unexpected error
 +Response from server:
    + Code: InternalServerError
    + Content: {
  "type": "urn:acme:error:serverInternal",
  "detail": "Error creating new authz",
  "status": 500
} ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
   at ACMESharp.AcmeClient.RequestHttpPost(Uri uri, Object message)
   --- End of inner exception stack trace ---
   at ACMESharp.AcmeClient.AuthorizeIdentifier(String dnsIdentifier)

Looking up this error, it seems like a known transient failure that should be retried (which indeed worked). Perhaps such retries could be incorporated into the ACME Client?