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 : unresolved site for given site reference #366

Open carragom opened 5 years ago

carragom commented 5 years ago

Environment

OS: Windows 2012 R2 Powershell: 5.1 Webserver: IIS

Description

Trying to automate my IIS server certificate using this ACME client. I followed the docs (including all the validation steps) up to the command Complete-ACMEChallenge:

The Exact Command

Complete-ACMEChallenge -IdentifierRef portal -ChallengeType http-01 -Handler iis -HandlerParameters @{WebSiteRef = 'Portal'}

The Error

Complete-ACMEChallenge : unresolved site for given site reference
At line:1 char:1
+ Complete-ACMEChallenge -IdentifierRef portal -ChallengeType http-01 - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Complete-ACMEChallenge], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,ACMESharp.POSH.CompleteChallenge

Looks like the iis handler can't find my IIS site Portal but if I do Get-Website I get the following:

Name             ID   State      Physical Path                  Bindings
----             --   -----      -------------                  --------
Portal           2    Started    C:\inetpub\wwwroot             https *:443: sslFlags=0

Any idea what am I doing wrong ?