Multiple HTTPS Bindings IIS 7 Using appcmd

Source: Internet
Author: User
Tags wildcard ssl

http://toastergremlin.com/?p=308

Sometimes when using a wildcard SSL or Unified Communications Certificate (UCC) It's necessary to add multiple HTTPS host Headers for a single IP. Unfortunately the IIS 7 GUI does not allow you to set a host header on a HTTPS binding however this can be achieved using The "appcmd" command.

1. First bind the certificate to one site as normal by adding the HTTPS binding through the IIS GUI.

2. Open a command prompt and navigate to C:\Windows\System32\Inetsrv\ using the command below:

cd C:\Windows\System32\Inetsrv\

3. Enter The following command to manually set the binding bearing the notes below:

appcmd set site /site.name:"SiteNameInIIS" /+bindings.[protocol=‘https‘,bindingInformation=‘IP.Add.re.ss:443:www.example.com‘]

Make sure to change the following values on the command above accordingly:

Sitenameiniis: The site name exactly how it appears in IIS. For instance "example.com".

IP. ADD.RE.SS: The IP used by the site.

www.example.com: the desired hostname. Note in the most cases there would be a for WWW and non-www.

Example command:

appcmd set site /site.name:"example.com" /+bindings.[protocol=‘https‘,bindingInformation=‘1.2.3.4:443:www.example.com‘]

Running the Appcmd command from a batch file:

To make this process easier you can use the batch file below. This would prompt you to the site name, IP, and Host header value and then make the appropriate host header change.

Save the code as something like "Addsslbinding.bat" and then call it from a command prompt by entering the name of the FIL E (ie. "Addsslbinding").


@echo off
echo Enter site name in IIS:
set /p SiteName=
echo Enter IP address:
set /p IP=
echo Enter host header value (ie. www.domain.com):
set /p HostHeader=
C:\Windows\System32\Inetsrv\appcmd set site /site.name:"%SiteName%" /+bindings.[protocol=‘https‘,bindingInformation=‘%IP%:443:%HostHeader%‘]

Example:

Multiple HTTPS Bindings IIS 7 Using appcmd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.