C# 请求已中止:无法创建SSL/TLS安全通道-SecurityProtocol行为
将证书安装到C# 请求已中止:无法创建SSL/TLS安全通道-SecurityProtocol行为,c#,.net,ssl-certificate,ssl,C#,.net,Ssl Certificate,Ssl,将证书安装到本地计算机受信任的根证书颁发机构的存储后,.NETWebRequest仍会抛出: The request was aborted: Could not create SSL/TLS secure channel ServicePointManager.SecurityProtocol现在包含SecurityProtocolType.Ssl3|SecurityProtocolType.Tls 在阅读Simon Dugré的回答后,我设置了: ServicePointManager.S
本地计算机
受信任的根证书颁发机构的存储后,.NETWebRequest
仍会抛出:
The request was aborted: Could not create SSL/TLS secure channel
ServicePointManager.SecurityProtocol
现在包含SecurityProtocolType.Ssl3
|SecurityProtocolType.Tls
在阅读Simon Dugré的回答后,我设置了:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
它工作正常。
后退后:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
它仍然可以正常工作。我有两个问题:
Ssl3
而不使用
同时使用Ssl3
和Tls
有SSL/TLS会话恢复,可能就是您的情况。 可能您没有共享的TLS1密码套件。
最好的检查方法是运行Wireshark,并查看连接的SSL数据包,Wireshark对这些数据包进行了很好的解释。我的解决方案是添加以下线路:
ServicePointManager.Expect100Continue = True
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls