How to enable SSL for IIS Express for DEV env in Visual Studio

How to enable SSL for IIS Express for DEV env in Visual Studio:

For already developed projects, after we download it from TFS, if the SSL is enabled, then we need to configure the SSL for IIS Express manually with a self signed  certificate.

First, we tell IIS Express to enable SSL for the required site that has been configured on a specific port.

eg: https://localhost:44037

The command for the above is as below...
cd C:\Program Files (x86)\IIS Express
IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:44037/ -UseSelfSigned
 After we run the above command for the required sites to be run on SSL, we start running the application.
Initially, ASP.NET will ask you to create a self signed certificate for the localhost. After accepting it, a self signed cert will be created under the Local Computer account of the cert store. This cert will be used for the IIS Express to work on SSL. Later you need to tell IIS Express to trust this certificate for the application to run.











When the site is running, you will be seeing warnings like below for using the cert. You can either ignore or add the localhost cert under personal folder to Trusted Root Certification Authorities.







Comments

Popular posts from this blog

Base 64 encoding and decoding

LINQ Queries with GROUP BY, INNER JOIN, COUNT and SUM: Examples

How to write Custom delete Confirmation Modal for Kendo Grid in MVC: