Skip to content

Commit

Permalink
detect additional ARI replaces errors and retry new order request wit…
Browse files Browse the repository at this point in the history
…hout the replaces field (#587)
  • Loading branch information
rmbolger committed Nov 18, 2024
1 parent d599243 commit 12dc664
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Posh-ACME/Public/New-PAOrder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ function New-PAOrder {
# ACME server should send HTTP 409 Conflict status if we tried to specify
# a 'replaces' value that has already been replaced. So if we get that,
# retry the request without that field included.
if (409 -eq $_.Exception.Data.status) {
# It will also send HTTP 404 for various other reasons that it can't find
# the cert to be replaced.
if ($_.Exception.Data.status -in 404,409) {
Write-Warning $_.Exception.Data.detail
Write-Verbose "Resubmitting new order without 'replaces' field."
$payload.Remove('replaces')
Expand Down

0 comments on commit 12dc664

Please sign in to comment.