![](/img/trans.png)
[英]make a request with TLS1.2 using IIS7.5 on Windows Server 2008 R2
[英]WebRequest fails over TLS 1.2 for Windows Server 2008 R2
我知道有人問過類似的問題,但是我的問題似乎有所不同,因為我嘗試了許多在網上找到的解決方案。 我的問題如下。
我正在運行IIS 7上安裝的.net 4.5.1 MVC應用程序,該應用程序向僅支持TLS 1.2的外部服務器發出安全的出站請求。 當我從Windows 7主機運行應用程序時一切正常,但是在Windows Server 2008 R2上,fils具有:
“請求已中止:無法創建SSL / TLS安全通道。”
在一開始,它在我的本地Windows 7上也失敗了,直到我在WebRequest之前添加了以下行並開始工作:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
但這並不能使其在服務器上正常工作。
我也嘗試添加:
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AllwaysGoodCertificate);
ServicePointManager.Expect100Continue = true;
但是沒有做任何改變。
我還嘗試在服務器上添加要接受的TLS 1.2協議,如此處所述https://support.quovadisglobal.com/KB/a433/how-to-enable-tls-12-on-windows-server-2008- r2.aspx
重新啟動計算機,但仍然沒有新內容。
提前非常感謝您,我對這個問題非常絕望:S
我解決了改變這條線
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
為了這
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.