Configure an existing SSL certificate on an IIS website that uses a host host

The idea is to automate the binding of an SSL certificate to a website in IIS 7 or higher.

All websites on the server use the same IP address and the same default port. Thus, they all differ by host header names.

I could achieve this manually without any problems. But there is a problem with automation.

When done manually, the ssl configuration entries in http.sys are written as TestName for HostNameport: 443, and not as ipport xx.yy.za: 443.

So, I wanted to imitate the same manual steps as for automation. But that does not help.

I tried the following steps.

  • Create a new ssl configuration in http.sys for the host name port combination using the command below.

netsh -% http add sslcert hostnameport = Testssl: 443 certhash = d70930bb790f89c04c728d9285b64f5fb0258fc7 appid = {01010101-0101-0101-0101-010101010101} certstorename = MY

  1. Create a new website binding for the website using the host name.

    New-ItemProperty IIS: \ sites \ TestSite -name bindings -value @ {protocol = "https"; bindingInformation = "192.168.1.108-00-0043:Testssl"}

    or

    New-WebBinding -Name TestSite -Protocol https -Port 443 -HostHeader Testssl -IPAddress 192.168.1.108

Using the above two steps, a new binding is present, but the SSL certificate is not bound to the binding.

Can't install an SSL certificate for binding with the corresponding host name port entry in http.sys ssl configuration?

0
source share
1 answer

With the comment of Lex Lee, the WORKS team below.

New-WebBinding -Name TestSite -Protocol https -Port 443 -HostHeader Testssl -IPAddress 192.168.1.108 -SslFlags 1

0
source

All Articles