Skip to content

Commit 5d6fd4d

Browse files
Anvil: if order fails due to invalid account replaces, re-attempt
1 parent 06e6ce4 commit 5d6fd4d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Certify.Providers/ACME/Anvil/AnvilACMEProvider.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,11 @@ private string GetAccountFingerprintHex(IKey accKey)
666666
abandonRequest = false;
667667
itemLog.Warning($"Encountered an order conflict. Action maybe re-attempted by resolving the conflict.");
668668
}
669+
else if (err.Status == System.Net.HttpStatusCode.Unauthorized)
670+
{
671+
abandonRequest = false;
672+
itemLog.Warning($"Order 'Unauthorized' problem. Order will be reattempted if applicable : {err.Detail}");
673+
}
669674
else if (err.Type?.EndsWith("accountDoesNotExist") == true)
670675
{
671676
// wrong account details, probably used staging for prod or vice versa
@@ -812,8 +817,8 @@ public async Task<PendingOrder> BeginCertificateOrder(ILog log, ManagedCertifica
812817
string ariReplacesCertId = null;
813818

814819
if (
815-
caSupportsARI &&
816-
managedCertificate.CertificateCurrentCA == managedCertificate.LastAttemptedCA
820+
caSupportsARI
821+
&& managedCertificate.CertificateCurrentCA == managedCertificate.LastAttemptedCA
817822
&& !string.IsNullOrWhiteSpace(managedCertificate.ARICertificateId)
818823
&& managedCertificate.ARICertificateId.Contains(".")
819824
&& managedCertificate.RenewalFailureCount < 3

0 commit comments

Comments
 (0)