Wildcard Certificate Mapping Multiple Web Servers using Single IP address

June 1, 2009 Off By David

Prerequisites

  • MakeCert.exe (Which should be part of a visual studio install or downloadable here)
  • winhttpcertcfg.exe (downloadable here)
  • APPCMD (Part of Vista / Server 2008 / Windows 7)
  • ‘Certificates’ snap-in for Personal and Local Computer using MMC

Method

Execute the following command from a command prompt

then

  • From the RUN command or start menu, type MMC
  • File > Add or Remove Snap-ins – Select Certificates, Click Add, Select My user account, Click Finish
  • Repeat previous step and select My Computer (then selecting Local Computer)
  • Click OK
  • Expand Certificates – Current User > Personal > Certificates
  • Right click *.domain.com and All Tasks > Export. The PFX file contains both the public and private key for this cert, hence why your asked for a password.
  • Copy or Move the Certificate from Current User > Personal > Certificates to Local Computer > Trusted Root Certification Authorities > Certificates
  • Import the PFX into Local Computer > Personal > Certificates (this will be the certificate used by your web services.

Now let’s create your web servers

Remove existing demo app pools and sites

Establish SSL Environment

Tell windows that Network Service is allowed access to your wildcard cert. and tell it to bind the cert to port 443 on your IP address

Then execute the following

Create App Pools and Sites

This is the code to create app pools and sites

…and that should be you 😉 Enjoy!