网站建设广告宣传素材,论坛网站制作教程,网站建设课程心得体会,wordpress 后台菜单 层级问题原因
如果网页能正常访问#xff0c;那就是TLS版本支持的问题。 我遇到的问题是#xff1a; 项目用的是NET Framework 4.6.1#xff0c;但是 learn.microsoft.com 提到 NET Framework 4.6及更早版本 不支持 TLS 1.1 和 TLS 1.2。 NET Framework 4.6.2 及更高版本 支持 …问题原因
如果网页能正常访问那就是TLS版本支持的问题。 我遇到的问题是 项目用的是NET Framework 4.6.1但是 learn.microsoft.com 提到 NET Framework 4.6及更早版本 不支持 TLS 1.1 和 TLS 1.2。 NET Framework 4.6.2 及更高版本 支持 TLS 1.1 和 TLS 1.2。 所以我也不知道夹在中间的 4.6.1 是个什么情况。。。
有两种方案
第一种改代码
System.Net.ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;第二种改为system.web参数 项目更改为.Net Framework 4.6然后修改web.config文件中的system.web参数为以下内容
system.webcompilation targetFramework4.6 / httpRuntime targetFramework4.6 /
/system.web问题详细情况参考地址
TLS版本支持描述 https://learn.microsoft.com/zh-cn/mem/configmgr/core/plan-design/security/enable-tls-1-2-client 同类问题描述 https://stackoverflow.com/questions/46223078/c-sharp-httpclient-an-existing-connection-was-forcibly-closed-by-the-remote-host