繁体   English   中英

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

[英]The request was aborted: Could not create SSL/TLS secure channel - SecurityProtocol behavior

将证书安装到Trusted Root Certification AuthoritiesLocal Computer存储中后,.NET WebRequest仍然会抛出:

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

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

阅读SimonDugré的回答https://stackoverflow.com/a/2904963/121968后 ,我设置了:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

它工作正常。 回头后:

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

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

  1. 为什么它仍然有效? 有没有缓存?

  2. 为什么它之前只使用标志Ssl3而不是Ssl3Tls

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

我的解决方案是添加以下行:

 ServicePointManager.Expect100Continue = True
 ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM