c# - Windows 10 + 请求被中止 : Could not create SSL/TLS secure channel

标签 c# ssl visual-studio-2012 windows-10 tls1.2

他在那里,

我遇到以下错误...

System.Net.WebException was caught
  HResult=-2146233079
  Message=The request was aborted: Could not create SSL/TLS secure channel.
  Source=System
  StackTrace:
       at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
       at System.Net.HttpWebRequest.GetRequestStream()

我正在尝试调用在 Windows 7 中工作的第三方 API.. 但在我升级到 Windows 10 后它失败了...

我还尝试使用下面的代码更改安全协议(protocol)

ServicePointManager.Expect100Continue = true;

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

我也试过像下面这样的一些注册表编辑..

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 
Value: SchUseStrongCrypto 

另一个奇怪的问题是它以交替方式连接...... 第一次连接但中止连续请求..

谁能帮我解决这个问题

注意:问题出现在我从 Windows 7 更新 Windows 10 之后。

最佳答案

我认为您使用的是采用 SHA1 加密的网络服务。 Windows 更新将阻止它,因为它有风险。

以下链接列出了更新。 https://blogs.windows.com/msedgedev/2016/04/29/sha1-deprecation-roadmap/

卸载更新,它应该可以工作。它对我有用。 但是,您应该考虑升级该 Web 服务。

到目前为止,我还没有找到以编程方式解决该问题的方法。

关于c# - Windows 10 + 请求被中止 : Could not create SSL/TLS secure channel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38695436/

相关文章:

ssl - 将 .crt 文件转换为 .cer 和 .key

php - 尝试使用 SwiftMailer : Connection could not be established with host smtp. gmail.com [#0] 通过 Symfony 2 发送电子邮件

查找模式的 C 函数始终返回 "no mode"

c# - 直接下载文件到内存

c# - 如何在页面之间传递参数

c# - C# 预处理器指令中运算符的优先级是什么?

c# - SSL 页面重定向到另一台服务器上的 SSL 页面

c# - 如何确定正在使用哪个 C# 设置文件

C# 用带值的元组实例化字典

c# - 什么时候 using 语句框它的参数,当它是一个结构?