2012-12-18 121 views
6

安裝證書到Local Computer存儲Trusted Root Certification Authorities後的.NET WebRequest仍然拋出:請求已中止:無法創建SSL/TLS安全通道 - SecurityProtocol行爲

The request was aborted: Could not create SSL/TLS secure channel 

ServicePointManager.SecurityProtocol現在包含SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls

讀西蒙Dugré的回答https://stackoverflow.com/a/2904963/121968後,我已設置:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; 

它工作正常。 設置後背上:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls; 

它仍然工作正常。我有兩個問題:

  1. 爲什麼它仍然有效?有緩存嗎?

  2. 爲什麼它以前只是標誌Ssl3工作,而不是 既Ssl3Tls

回答

1

有SSL/TLS會話恢復,可能是你的情況。 也許你沒有共享的TLS1密碼套件。 檢查的最佳方法是運行Wireshark,並查看SSL數據包以進行連接,在Wireshark中對它們進行了很好的說明。

0

我的解決辦法是添加行:

ServicePointManager.Expect100Continue = True 
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls 
相關問題