IIS Express — Getting SSL to Work

久未见 提交于 2019-11-27 17:48:00
jbtule

After you've set a project to use IISExpress, press F4 while the project is selected on the solution explorer to bring up the properties and in the properties set SSL Enable set true and under SSL URL set the URL with the port (443 in your case) you want for the SSL.

This works for me without going under the hood and the self signed certificate was automatic.

To run the project on that URL by default, you can right click on the project, select properties, then Web and replace the Project Url with https://localhost:443

I stumbled across the answer.

In step 6, I was modifying the wrong IIS Express application.config file. It turns out there is a "master" config file in the application's home directory (e.g., C:\Program Files (x86)\IIS Express\AppServer, on my system), which is the one I modified.

The second and correct file to modify is the one in the User data area (e.g., C:\Users\Mark.ARCABAMA\Documents\IISExpress\config, on my system).

If you have followed jbtule's steps and SSL is still not working, ensure that your port is in the format :443XX.

Visual Studio did this automatically for the first project I enabled SSL on, but any subsequent projects seem to have random SSL ports. Changing it to the above 443 structure under the Project > Web UI got it up and working for me.

I would just like to add the solution that helped me with the same issue.

VS showed an SSL URL that was https://[an IP, not localhost]:44367

The url was reserved, which I found with netsh http show urlacl

I then ran netsh http delete urlacl https://[an IP, not localhost]:44367, rebooted VS, turned SSL off by setting SSL to false, and then on again. This corrected the SSL URL.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!