How do you use https / SSL on localhost?

HShbib picture HShbib · May 3, 2011 · Viewed 124.6k times · Source

I would like to know how to setup SSL on my web application on the localhost.

I have no background in doing this, would appreaciate guidance. I already finished implementing my web application and i need it to use https on the localhost or while I host it on a server.

Any Ideas?

Regards.

Answer

JackArbiter picture JackArbiter · Oct 21, 2015

If you have IIS Express (with Visual Studio):

To enable the SSL within IIS Express, you have to just set “SSL Enabled = true” in the project properties window.

See the steps and pictures at this code project.

IIS Express will generate a certificate for you (you'll be prompted for it, etc.). Note that depending on configuration the site may still automatically start with the URL rather than the SSL URL. You can see the SSL URL - note the port number and replace it in your browser address bar, you should be able to get in and test.

From there you can right click on your project, click property pages, then start options and assign the start URL - put the new https with the new port (usually 44301 - notice the similarity to port 443) and your project will start correctly from then on.

enter image description here