请求被中止:无法创建SSL/TLS安全通道 - SecurityProtocol行为

6
在将证书安装到“受信任的根证书颁发机构”的本地计算机存储器后,.NET WebRequest仍然会抛出以下异常:
The request was aborted: Could not create SSL/TLS secure channel

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

在阅读了Simon Dugré的答案https://dev59.com/vXE85IYBdhLWcg3wRBRU#2904963之后,我进行了以下设置:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

它运行良好。 设置后:

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

它仍然可正常工作。我有两个问题:

  1. 为什么它仍然可以工作?是否有一定的缓存机制?

  2. 之前为什么只使用标志Ssl3而不是同时使用Ssl3Tls呢?

2个回答

1

可能您的情况是SSL/TLS会话恢复。也许您没有共享TLS1密码套件。 检查的最佳方法是运行Wireshark,并查看您连接的SSL数据包,它们在Wireshark中有非常好的解释。


0
我的解决方案是添加以下行:
 ServicePointManager.Expect100Continue = True
 ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接