How to change IIS Express SSL port without WebMatrix

September 30, 2011

Nerd

 

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:

image

 


Quick IIS Express 101:

After you’ve installed VS2010 SP1 & IIS Express, right-click your project & select “Use IIS Express”

image

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:

image

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

image

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)

image

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” />

to

    <binding protocol=”https” bindingInformation=”*:44308:localhost” />

6. Save & close.

Voila! That’s all it takes to change the SSL port in IIS Express =) Enjoy!

5 Comments on “How to change IIS Express SSL port without WebMatrix”

  1. Pete Shearer Says:

    Cori,

    Any chance you can make your RSS feed have your entire posts? Yours is the only blog in my RSS feed that does abbreviated posts and often, while reading at work or on my phone, I never click through and your posts end up “lost” to me.

    You’re using WordPress so it should just be a small configuration change.

    Thanks.

    Reply

    • TruncatedCoDr Says:

      Hi Pete,
      I updated the setting & hope to post a blog entry in the next day or so. Please let me know if it’s still showing partial text (I’m still new at this) & thank you :-)

      Reply

  2. TruncatedCoDr Says:

    After writing this, I ran across this post: http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx

    It’s much more detailed & goes into how to use IIS Express with a trusted cert.

    My post implements the “K.I.S.S.” methodology (simply describing how we addressed the immediate need we had to solve at work =).

    Reply

  3. Pete Shearer Says:

    Cori,

    Worked like a champ! Thanks.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: