ebekker / ACMESharp

An ACME client library and PowerShell client for the .NET platform (Let's Encrypt)
https://pkisharp.github.io/ACMESharp-docs/
1.21k stars 184 forks source link

Complete-ACMEChallenge -CleanUp fails with exception #323

Closed echoburn closed 6 years ago

echoburn commented 6 years ago

Hi there,

Cert generation using the Cloudflare handler works fine apart from the cleanup step at the end.

The following command results in an 'object reference not set to an instance of an object' exception:

Complete-ACMEChallenge $alias -CleanUp -ChallengeType dns-01 -Handler CloudFlare -HandlerParameters @{DomainName=$cloudflareDomain;EmailAddress=$cloudflareEmail;AuthKey=$cloudflareKey}

I can repro this with the following full example:

$cloudflareDomain = "cf.domain.com"
$cloudflareEmail = "cf@email.com"
$cloudflareKey = "cfkkkkey"
$alias = "alias"
New-ACMEIdentifier -Dns xxx.domain.com -Alias $alias

Complete-ACMEChallenge $alias -ChallengeType dns-01 -Handler CloudFlare -HandlerParameters @{DomainName=$cloudflareDomain;EmailAddress=$cloudflareEmail;AuthKey=$cloudflareKey}
Submit-ACMEChallenge $alias -ChallengeType dns-01
Update-ACMEIdentifier

New-ACMECertificate -Generate -IdentifierRef $alias -Alias $alias
Submit-ACMECertificate -CertificateRef $alias

Complete-ACMEChallenge $alias -CleanUp -ChallengeType dns-01 -Handler CloudFlare -HandlerParameters @{DomainName=$cloudflareDomain;EmailAddress=$cloudflareEmail;AuthKey=$cloudflareKey}
echoburn commented 6 years ago

Nevermind - I see there is already an issue for this