Configure host headers with SSL using IIS 7 or IIS 7.5

I recommend

I configured SSL on this blog site and found some info on the Microsoft TechNet page Configure a Host Header for a Web Site (IIS 7). The TechNet page was a start, but it didn’t quite get me all the way there. With a bit of experimentation I successfully configured SSL on my web server. You can view a screencast of what I did at the end of this post.

For this post I’m going to use a non-existent website www.abc-test1.com.

First I added an SSL binding to the web site. In IIS Manager, with the web site selected, click on the Bindings… link.

Actions Bindings

On the Site Bindings dialog you’ll want to click the Add… button.

Site Bindings Dialog

Then select https from the Type drop list, select your IP address, and pick your installed SSL certificate. For my testing I created a self signed certificate.

Add Site Binding

Then from the command prompt you’ll want to issue the command:

appcmd set site /site.name:www.abc-test1.com /bindings.[protocol='https',bindingInformation='*:443:'].bindingInformation:*:443:www.abc-test1.com

You can go back in IIS manager to check you SSL binding’s host name. You should see the host header you configured at this point.

Site Bindings with host header

I created this tutorial describing how to configure host headers in IIS 7.5 using Windows 7. It is the same process for any version of IIS 7.x.

I hope this post helps :-)

IIS Technical December 3, 2009


Comments

The UI for the IIS Manager seems to key off of the "Friendly Name" of the certificate. For example if you have a wild card certificate that is installed for the server (i.e. *.mydomain.com) and you give it a friendly name of "wwwmydomain" then the UI protects the host header field when editing the bindings. To have the IIS Manager unprotect the HostHeader field, give the certificate a friendly name begining with an asterik "*" (i.e. *.mydomain.com). With this friendly naming convention, the IIS Manager UI unprotects the host header field and allows you to specify your host header as desired. If you already imported the certificate, you can use the Certificate Services MMC snap-in to change the friendly name of the certificate. I'm uncertain as to why the IIS team doesn't specify this anywhere or if they know it can be done as I haven't found any documentation on this "feature", I just happened to stumble upon it while working in my development environment. Hope that helps some of you out there in your day to day managment of IIS, however if you are doing any major management of IIS servers you should look at the Microsoft Managment APIs to automate much of your administration. Cheers

cbuzzsaw - June 8, 2010

Hi, Site stops working after I assign the host name to the site with https.... any clue.... It works fine without host headers setting... Thanks.....

Varsha Motwani - February 1, 2011

I apologize for taking so long to respond, life has been really busy :-) Have you set a host header for the http binding? Do you get an error or does the site hang? Does the host name show up in the bindings when looking in IIS manager? Are you trying to host multiple sites bound to one IP address? In general one question to ask is, do you need to use a host header in the binding? You only really need to use host headers if you are hosting multiple domains on the same server and do not have multiple IP addresses available.

Nathan Fox - February 7, 2011

Hey there, running II7 and have 4 sites using the same IP and UCC cert. I follow the steps and add a https binding first and choose the cert. Then i run the code and it adds another HTTPS binding with the host header, but when you edit it, it has no cert assigned. When you assign the cert. the host header goes away.. soo frustrating. Any ideas?

Jason - July 14, 2011