Skip to content

Commit

Permalink
Anvil: if order fails due to invalid account replaces, re-attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
webprofusion-chrisc committed Nov 19, 2024
1 parent 06e6ce4 commit 5d6fd4d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Certify.Providers/ACME/Anvil/AnvilACMEProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,11 @@ private string GetAccountFingerprintHex(IKey accKey)
abandonRequest = false;
itemLog.Warning($"Encountered an order conflict. Action maybe re-attempted by resolving the conflict.");
}
else if (err.Status == System.Net.HttpStatusCode.Unauthorized)
{
abandonRequest = false;
itemLog.Warning($"Order 'Unauthorized' problem. Order will be reattempted if applicable : {err.Detail}");
}
else if (err.Type?.EndsWith("accountDoesNotExist") == true)
{
// wrong account details, probably used staging for prod or vice versa
Expand Down Expand Up @@ -812,8 +817,8 @@ public async Task<PendingOrder> BeginCertificateOrder(ILog log, ManagedCertifica
string ariReplacesCertId = null;

if (
caSupportsARI &&
managedCertificate.CertificateCurrentCA == managedCertificate.LastAttemptedCA
caSupportsARI
&& managedCertificate.CertificateCurrentCA == managedCertificate.LastAttemptedCA
&& !string.IsNullOrWhiteSpace(managedCertificate.ARICertificateId)
&& managedCertificate.ARICertificateId.Contains(".")
&& managedCertificate.RenewalFailureCount < 3
Expand Down

0 comments on commit 5d6fd4d

Please sign in to comment.