Skip to content

Commit

Permalink
deduplicate the Domain param in New-PAOrder to avoid errors caused by…
Browse files Browse the repository at this point in the history
… the ACME server doing it later (#517)
  • Loading branch information
rmbolger committed Oct 3, 2023
1 parent cb230d5 commit a997eaa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Posh-ACME/Public/New-PAOrder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ function New-PAOrder {
$OCSPMustStaple = New-Object Management.Automation.SwitchParameter($csrDetails.OCSPMustStaple)
}

# De-dupe the domain list if necessary
$domainCount = $Domain.Count
$Domain = $Domain | Select-Object -Unique
if ($domainCount -gt $Domain.Count) {
Write-Warning "One or more duplicate domain values found. Removing duplicates."
}

# If importing a key, make sure it's valid so we can set the appropriate KeyLength
if ('ImportKey' -eq $PSCmdlet.ParameterSetName) {
$KeyFile = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($KeyFile)
Expand Down

0 comments on commit a997eaa

Please sign in to comment.