简体   繁体   English

WebRequest针对Windows Server 2008 R2的TLS 1.2进行故障转移

[英]WebRequest fails over TLS 1.2 for Windows Server 2008 R2

I know similar questions have been asked, but my problem seems to be different, as I have tried many of the solutions I have found on the web. 我知道有人问过类似的问题,但是我的问题似乎有所不同,因为我尝试了许多在网上找到的解决方案。 My problem is as following. 我的问题如下。

I'm running a .net 4.5.1 MVC application installed on IIS 7, which makes secure outbound requests to an external server supporting only TLS 1.2. 我正在运行IIS 7上安装的.net 4.5.1 MVC应用程序,该应用程序向仅支持TLS 1.2的外部服务器发出安全的出站请求。 All goes fine when i run the application from Windows 7 host, but on Windows Server 2008 R2 is fils with: 当我从Windows 7主机运行应用程序时一切正常,但是在Windows Server 2008 R2上,fils具有:

"The request was aborted: Could not create SSL/TLS secure channel." “请求已中止:无法创建SSL / TLS安全通道。”

In the beginning it was failing also on my local Windows 7, until I added this line before the WebRequest and worked: 在一开始,它在我的本地Windows 7上也失败了,直到我在WebRequest之前添加了以下行并开始工作:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

But this didn't make it work on the server. 但这并不能使其在服务器上正常工作。

I also tried adding: 我也尝试添加:

ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AllwaysGoodCertificate);
ServicePointManager.Expect100Continue = true;

But didn't make any changes. 但是没有做任何改变。

I also tried on the server to add TLS 1.2 protocol to be accepted, as explained here https://support.quovadisglobal.com/KB/a433/how-to-enable-tls-12-on-windows-server-2008-r2.aspx 我还尝试在服务器上添加要接受的TLS 1.2协议,如此处所述https://support.quovadisglobal.com/KB/a433/how-to-enable-tls-12-on-windows-server-2008- r2.aspx

Restarted the machine, but still nothing new. 重新启动计算机,但仍然没有新内容。

Thank you very much in advance, I'm getting quite desperate with this issue :S 提前非常感谢您,我对这个问题非常绝望:S

I solved it changing this line 我解决了改变这条线

    System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

for this 为了这

    System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows Server 2008 R2上使用IIS7.5使用TLS1.2发出请求 - make a request with TLS1.2 using IIS7.5 on Windows Server 2008 R2 在 Windows Server 2012 R2 上构建的应用程序在 Windows Server 2008 R2 上失败 - Application built on Windows Server 2012 R2 fails on windows server 2008 R2 连接到Windows Server 2008 R2时LsaEnumerateAccountsWithUserRight失败 - LsaEnumerateAccountsWithUserRight fails when connecting to Windows Server 2008 r2 如何为Windows Server 2012 R2的出站请求启用TLS 1.2? - How to enable TLS 1.2 for outbound request from windows server 2012 R2? 你怎么知道在 Windows 服务器 2008R2 上用于 TLS 1.2 的密码版本是什么 - How can you tell what cipher version is used on Windows server 2008R2 for TLS 1.2 如何在Windows Server 2008 R2 Enterpresi和.NET中的Web应用程序上设置TLS证书? - How can I setup TLS certificate on Windows Server 2008 R2 Enterpresi and Web application in .NET? Windows服务在Windows 7上启动,但在Windows Server 2008 R2上无法启动 - Windows service starts on Windows 7 but fails to start on Windows Server 2008 R2 显示Windows Server 2008 R2 - display windows server 2008 R2 在 Windows Server 2008 R2 中使用 Redis - Using Redis in Windows Server 2008 R2 Windows Server 2008 R2上的WPF样式 - WPF styling on Windows Server 2008 R2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM