If you’ve ever had the displeasure of installing a fake SSL cert into localhost on your development box, you know why this property made me run from Cassini to IIS Express without looking back:
Quick IIS Express 101:
Doing that will assign & configure a port to your site. By default, SSL will not be enabled.
For example, when I did that with this test app, it assigned the non-SSL port to be 20568 (http://localhost:20568/).
If I want to change that value, I right-click on the project, select “properties,” and go to the web tab.
From this screen, I can easily change the non-SSL port:
Adding SSL to IIS Express localhost site
With the properties WINDOW open (“View—>Properties Window” which is different than right-clicking on the project & selecting “properties”), click on the project in Solution Explorer.
By default, you will see “SSL Enabled” is set to False.
When you set it to true, the SSL Url will auto-populate to the next auto-incremented port number on your local environment (based on how many SSL projects you’ve developed locally), starting with 44300.
Why we need to change the SSL port
My web search results for how to change the SSL port in IIS Express have returned instructions that say it’s only possible using WebMatrix.
We have configuration values that must match in dev environments so we don’t have to change the “facebook dev app” ssl url for every developer (concurrently) working on a facebook app in our shop.
How to change the SSL port
We use Visual Studio, so asking devs to install WebMatrix just to change the SSL port is not really feasible (convincing them to install SP1 & IIS Express has been hard enough).
After you run your app, you’ll see IIS Express in your system tray
1. Right-click on that system tray icon and select “Show All Applications”
2. Click on the Site Name of the ssl site you want to change (in this example, it would be IISExpressExample.Web with the ssl url)
3. Click on the link referenced in Config so it opens applicationhost.config for the site you want to change the SSL for.
4. Ctrl + F the ssl port number (in this example, I searched for 44308)
5. Change the binding protocol port number to match your coworker’s
In this example, I changed
<binding protocol=”https” bindingInformation=”*:44301:localhost” />
<binding protocol=”https” bindingInformation=”*:44308:localhost” />
6. Save & close.
Voila! That’s all it takes to change the SSL port in IIS Express =) Enjoy!