欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Visual Studio开启 启用 SSL的支持 关闭 停止 禁用SSL 有大用 有大大用

下图是我的做法


由于当前已将此 Web 项目配置为使用此 URL 浏览,因此不能从此网站中删除 SSL。您需要先使用 Web 属性页,将项目 URL 更改为非安全 URL。

image.png



现在,最新的 Visual Studio IDE 版本(如 2017 和 2019 Web 应用程序中的新模板预设为使用 SSL,它们带有 https 协议,但可以使用基本 Web 设置禁用它。在本文中,我们将看到在 Visual Studio 2019 中从 MVC Web 应用程序禁用 SSL 的步骤。

问题

在本文中,我们将看到在 Visual Studio 2019 中从 MVC Web 应用程序禁用 SSL 的步骤,默认情况下,在较新版本的 Visual Studio 中,Web 应用程序预设为 https 协议。

解决方案

要解决此问题,只需按照以下步骤操作。我们可以从网络属性中删除 SSL。如果您尝试将属性“启用 SSL”设置为 false,它将引发以下错误。

从属性禁用

不允许

您无法从此站点删除 SSL,因为此 Web 项目当前配置为使用此 URL 浏览。您需要先使用Web 属性页将项目URL 更改为非安全URL。

错误信息

对于第一个打开的网络属性并将“https”更改为“http”  

 右击项目名称 看到属性 然后如下图,看到web    )

公开财产

更改设置

它将弹出一条消息并要求创建一个虚拟目录来配置应用程序。单击“是”以允许。

(  点击 创建虚拟目录 就可以了 )

image.png

允许并保存设置

保存设置后,您可以从项目属性中禁用 SSL,您就完成了。

从属性禁用

希望对你有帮助。


来自  http://dotnet-concept.com/Tips/2019/12/5799872/Disabling-SSL-from-MVC-application-in-Visual-Studio-2019


Now a day, new templates in latest visual studio IDE versions like 2017 and 2019 web applciations in preset to use SSL and they are coming with https protocol but it can be disabled using basic web settings. In this article we will see the steps to disable SSL from MVC web application in Visual Studio 2019.

The Problem

In this article we will see the steps to disable SSL from MVC web application in Visual Studio 2019, by default in newer version of Visual Studio, web applications are preset with https protocol.

The Solution

To resolve this issue, just follow below steps. We can remove SSL from web properties. If you try to set property "SSL Enabled" to false it will throw below error.

disable from property

not allowed

You can't remove SSL from this site because this Web project is currently configured to browse with this URL. You need to use the Web property page to change the project URL to the non-secure URL first.

error message

For that first open web property and change "https" to "http"

open property

change the settings

It will popup a message and ask to create a virtual directory to configure the application. Click "Yes" to allow.

allow and save setting

Once setting are saved, you can disable the SSL from project property and you are done.

disable from property

Hope it helps you.


来自  http://dotnet-concept.com/Tips/2019/12/5799872/Disabling-SSL-from-MVC-application-in-Visual-Studio-2019





Visual Studio开启SSL的支持

前提:

请确保已经安装了IIS Express

具体操作:

1、web项目->【右键】->【使用IIS Express】转换工程的Web服务器。

2、点击web项目,按【ctrl】+【w】,再按【p】,出现属性列表。如下:

3、选择上面的【已启动SSL】,改为【True】即可。

此时,你会发现上面的属性页面多出了一个地址,如下:

4、打开【C:\Users\你的用户名\Documents\IISExpress\config\applicationhost.config】,修改如下:

假设我上面的工程名为:WebApplication3,那么直接搜索这个工程名。因为配置文件是直接对应工程名的。

可以看到,已经加入了https的端口44300,而http的则为65068。这里是自动加的,前提是你勾选了上面的选项,但不排除一些原因没成功加入,可以自行手动加入。

现在可以访问测试一下,看是否生效。

来自  https://www.cnblogs.com/imPedro/p/11297577.html


普通分类: