c#"请求被中止: 未能创建 SSL/TLS 安全通道"解决方法
在.NET 4.5中,对此的解决方案是
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
如果您没有.NET 4.5,那么请使用
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
要执行请求前加上
ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;
本文介绍了解决 C# 中 请求被中止:未能创建SSL/TLS安全通道 的错误方法。主要针对 .NET4.5 及其以下版本,通过设置 ServicePointManager.SecurityProtocol 属性来指定 TLS 版本来解决问题。

被折叠的 条评论
为什么被折叠?



