rmbolger / Posh-ACME

PowerShell module and ACME client to create certificates from Let's Encrypt (or other ACME CA)
https://poshac.me/docs/latest/
MIT License
752 stars 186 forks source link

DNSimple Plugin regression #549

Closed dvdgutzmann closed 4 months ago

dvdgutzmann commented 4 months ago

Hi!

In https://github.com/rmbolger/Posh-ACME/commit/01c3764ca7f331ed937ccf9c9295ebdaff2a84d0 the Write-Debug (https://github.com/rmbolger/Posh-ACME/blame/8236403fff306555f0ec9a7eb7ecf2ed33653d9f/Posh-ACME/Plugins/DNSimple.ps1#L253) was guarded with an if-statement. The Write-Debug was later in https://github.com/rmbolger/Posh-ACME/commit/ea925c8d9966094c98853fa7692fd65bdbf2bfaa replaced with a throw - which now causes our orchestrating code to crash. The condition should be corrected to $_.Exception.Response.StatusCode -ne 404

            if ($_.Exception.Response.StatusCode -ne 404) {
                throw
            }

Thanks! David

rmbolger commented 4 months ago

Hey @dvdgutzmann, thanks for reaching out. Sorry about that. This looks to be a PowerShell 5.1 specific issue I had forgotten was different. The Microsoft.PowerShell.Commands.HttpResponseException that PS 7+ returns does actually have a StatusCode field. But the System.Net.WebException that PS 5.1 returns doesn't.

I should have it fixed shortly.

rmbolger commented 4 months ago

Fix live in 4.23.1

dvdgutzmann commented 4 months ago

Thank you very much - everything is working as expected again. Great response time, by the way. We really appreciate you!

Thanks! David