Search code examples
iisdockerlets-encryptwindows-container

LetsEncrypt-ACMESharp http-01 challenge on IIS invalid


On server A (non-IIS) I executed:

Import-Module ACMESharp
Initialize-ACMEVault
New-ACMERegistration -Contacts mailto:[email protected] -AcceptTos
New-ACMEIdentifier -Dns www.derryloran.com -Alias dns1
Complete-ACMEChallenge dns1 -ChallengeType http-01 -Handler manual

Response back asked:

* Handle Time:      [08/05/2017 22:46:27]
* Challenge Token:  [BkqO-eYZ5sjgl9Uf3XpM5_s6e5OEgCj9FimuyPACOhI]
To complete this Challenge please create a new file
under the server that is responding to the hostname
and path given with the following characteristics:
  * HTTP URL:     [http://www.derryloran.com/.well-known/acme-challenge/BkqO-eYZ5sjgl9Uf3XpM5_s6e5OEgCj9FimuyPACOhI]
  * File Path:    [.well-known/acme-challenge/BkqO-eYZ5sjgl9Uf3XpM5_s6e5OEgCj9FimuyPACOhI]
  * File Content: [BkqO-eYZ5sjgl9Uf3XpM5_s6e5OEgCj9FimuyPACOhI.X-01XUeWTE-LgpxWF4D-W_ZvEfu6ue2fAd7DJNhomQM]
  * MIME Type:    [text/plain]

Server B is serving www.derryloran.com a page at http://www.derryloran.com/.well-known/acme-challenge/BkqO-eYZ5sjgl9Uf3XpM5_s6e5OEgCj9FimuyPACOhI correctly I believe but when I then, back on Server A execute:

Submit-ACMEChallenge dns1 -ChallengeType http-01
(Update-ACMEIdentifier dns1 -ChallengeType http-01).Challenges | Where-Object {$_.Type -eq "http-01"}

...but the status goes invalid after a few seconds. FWIW I've tried this several times always with same result. Why? What am I doing wrong?

I appreciate there's a lot more to go once I've got the certificate but the site is being served in a docker container hence the Server A/B complexities...


Solution

  • Omg, how many times?!? The file had a BOM when created in VS. Recreating using Notepad++ and saving as UTF-8 (without BOM) and I'm getting a valid response now.