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.example.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.
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.
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. *.companydomain.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, you're golden.
Boom.
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
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.
The SSLShopper answer did not work for me because it left the binding without the host header, and you couldn't remove that binding without breaking the connection to the certificate. Here is the method I used to get it to work:
Please note that this answer assumes that your certificate has already been generated, added to the certificate store, and added to IIS. It also assumes you do not want any other bindings to your website besides the SSL one.
First, we need to gather some information. We need the hash, the application ID and the host name.
Steps
Open a command prompt
Save the Certificate Hash and the Application ID
At the command prompt:
Note: Appcmd.exe can be found in C:\Windows\System32\inetsrv. You may need to be in that folder for this command to work.
The accepted answer here is confusing and I don't think it's correct for the question. It shouldn't be the accepted answer.
The problem
You have a wildcard SSL such as
*.ipsum.com
and the certificate is installed but you can't choose a host name for the site in IIS when you try to add an HTTPS binding because the text box is greyed out.The solution
Your wildcard SSL can be used with any subdomain, you just need to make sure you start the Friendly Name of the certificate with
*
. I prefer to use the same friendly name as the wildcard domain, e.g.*.ipsum.com
but you can call it anything that beings with the asterix:*foo
I gave my certificate the wrong Friendly Name, help!
Since Windows 8 or Server 2012, you can type
certlm.msc
in the start menu to manage certificates for the local machine. On previous versions of windows you will need to do something slightly more convoluted:mmc.exe
from startFile
menu and chooseAdd/Remove Snap-in...
or hit(Ctrl-M)
Certificates
snap-in and hitAdd >
then chooseComputer Account
followed byLocal Computer
in the subsequent dialogs then hitFinish
followed byOK
to close the Snap-ins windowIn the main window, expand
Certificates (Local Computer)
thenPersonal
thenCertificates
and you will be able to right-click the certificate, hitProperties
where you can update the friendly name.Close and open IIS Manager and you can then set your host name.
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
Some machines won't let you edit the host name if the protocol is changed to https or after adding an SSL certificate. IIS can be grumpy at times.
This Windows command will create a new binding with protocol "https", on port "443", host name "subdomain.domain.com", site name "site name". Change those values (in quotes) to meet your requirements. You will then need to delete the old binding if its using port 443.
C:>
cd C:\Windows\System32\inetsrv
C:\Windows\System32\inetsrv>
appcmd set site /site.name:"site_name" /+bindings.[protocol='https',bindingInformation='*:443:subdomain.domain.com']
Hostname can be added only when the friedlyname of the selected Certificate will be like hostname *.xyz.com and You can rename certificate friendly name to *.xyz.com from mmc(Snap-in).
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
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!