Visual Studio 2013 Use HTTPS (SSL) On Web Application Projects

时间:2022-02-17 14:21:32

公司调试HTTPS接口会用到,原文:http://www.codeproject.com/Tips/766918/Visual-Studio-Use-HTTPS-SSL-On-Web-Application-Pro

Introduction

Sometimes (increasingly), we need to develop and deploy a secure web site that uses https protocol.

Within the new version of Visual Studio (2013), we now can easily create, develop and test our web application on https.

How To

To enable the secure https protocol within our web projects, just follow these steps.

Once you have created your project, go in the properties window and search the setting property "SSL Enabled" by default is set to False.

Visual Studio 2013 Use HTTPS (SSL) On Web Application Projects

Set the "SSL Enabled" property to True.

Visual Studio 2013 Use HTTPS (SSL) On Web Application Projects

Once you change the value, Visual Studio set in automatic the SSL URL, e.g., https://localhost:44301/.

At this point, we can go in the advanced properties of the project (Alt + Enter), select the Web tab and set the Project URL with the same value of SSL URL, e.g., https://localhost:44301/.

Visual Studio 2013 Use HTTPS (SSL) On Web Application Projects Once you have configured the default URL of the web application, we can run the site (F5 or CTRL + F5).

The first time you set the secure protocol on IIS Express, you will be prompted to install the certificate for SSL.

Visual Studio 2013 Use HTTPS (SSL) On Web Application Projects

After installation, now you can browse our application using the https protocol!

Visual Studio 2013 Use HTTPS (SSL) On Web Application Projects

I hope you enjoy.

Happy coding! Visual Studio 2013 Use HTTPS (SSL) On Web Application Projects