Consider a Win 2008 SP2 machine with IIS7. The task is to apply a certificate and host name to the one and only Site on this machine. The site's host headers need to be abc.123.mysite.com

The first step was installing the .pfx to the Personal Store, which was successful.

IIS7 finds the cert as available, but won't allow the entry of a host name. The host name textbox is ALWAYS disabled/greyed out, even before selecting my cert. I've even deleted the default port 80 binding.

alt text

Question: how can I set a host name for this site? Is it a matter of this cert being a wildcard cert? I understand that the SSL request comes into the web server, and the host header in the packet is encrypted. Why then would IIS6 allow the host header to be specified, but IIS7 not?

Update: The cert isn't part of the problem. I've created a new Site on the machine, and when choosing https binding, the host name textbox is disabled.

link|improve this question

feedback

6 Answers

up vote 7 down vote accepted

You can't do it from the UI, you have to do it from the command line. Here's a nice walk through of the process:

http://www.sslshopper.com/article-ssl-host-headers-in-iis-7.html

link|improve this answer
1  
handy trick, give the cert a friendly name starting with '*' an IIS won't gray out the host-header box: blog.armgasys.com/?p=80 – russau Aug 4 '10 at 4:22
feedback

The short answer is that each IP can only have one certificate bound to it, so the certificate binding is going to apply no matter what hostname is directed to that IP address. Being able to specify a hostname would imply that you can have multiple hostname and certificate combinations on the same IP address and port (as you can with non-SSL entries), but this is not the case, so the field is unavailable.

The more complete explanation is that SSL encrypts your traffic, and part of that traffic is the HTTP headers sent by the browser to the server. One of those headers would be the "Host" header which IIS uses to determine which site to load up with the request. Since the certificate needs to be loaded to establish the secure connection BEFORE the request headers are sent, IIS has to select the certificate based only upon the IP address and port number, leaving the "Host" header out in the cold as a factor in determining which site to load, so they don't let you enter one.

Here is an article which outlines the inner workings of the SSL connection in finer detail.

link|improve this answer
Thanks for this answer, Justin. I am still unsure why IIS7 doesn't let me specify a host header, even when I pick one of the IP addresses in the list. IIS6 does without any problems. As mentioned, this is the one and only site on the machine. – p.campbell Dec 23 '09 at 2:56
Host headers can work with a wildcard cert, or a multi-domain "UC" cert: sslshopper.com/unified-communications-uc-ssl-certificates.html. In this case the server only has 1 cert to serve even tho there is multiple hostnames. – russau Aug 4 '10 at 4:24
feedback

Actually, you can add a host header via the gui, but it depends on how the certificate is named ... if I give a friendly name of *.xyz.com to my wildcard cert, and select that cert, then i'm able to use the gui. if the friendly name is something like xyzwildcard, and I choose that, then it grays out the hostheader field...

Weird weird

link|improve this answer
feedback

Its does work in GUI...

Just make sure the the 'friendly name' of the cert you are installing is the same as the multidomainname you have made for the cert.

ie. *.compnaydomain.com

if you put in 'Nice friendly name' for *.companydoman.com cert, when installing the cert into IIS, it will grey out the host name header box.

If you use *.companyname.com as the friendly name, your golden.

Boom.

Lindsay Rex.

link|improve this answer
feedback

I think this KB article will shed some light on the issue. In a nutshell HTTP 1.1 host headers are not supported when you use SSL.

What will probably accomplish what you want is to use the SecureBindings metabase key. E.g. cscript.exe adsutil.vbs set /w3svc/websiteID/SecureBindings "ip.ip.ip.ip:443:abc.123.mysite.com

link|improve this answer
Doesn't apply to IIS 7. – davidcl Jan 22 '10 at 17:58
that's odd since it worked when we did it... – Jim B Jan 23 '10 at 1:09
feedback

Why MS takes this OUT of the GUI is beyond me, since, if you have an ASP.NET application that makes use of license files (licx), your site will not work because it shows up as an IP address instead of a domain name. They need to STOP ASSUMING on every new release of their software - IT people do not need to be babysitted by Microsoft! Geez!

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.