You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

向外部API发送SOAP请求时出现SSL/TLS安全通道创建失败问题

.NET调用外部SOAP API时SSL/TLS安全通道创建失败问题
  • 向外部API发送SOAP请求时,出现**"Could not create SSL/TLS secure channel"**错误
  • 该请求在SoapUI中可正常运行,但在.NET Framework 4.6.2应用中始终失败,无论是否附加X509证书都会触发相同错误

已尝试的解决操作

  • 切换至.NET Framework 4.8.1和.NET 6.0版本,问题依旧存在
  • 结合ServicePointManager.Expect100Continue = true;,尝试设置不同的TLS通信版本:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
  • 使用Tls12和Tls11时,服务器返回原错误;使用Tls13和Ssl3时,出现**"Win32Exception: 客户端和服务器无法通信,因为它们没有共同的算法"**错误,推测应使用Tls12或Tls11协议
  • 重载ServicePointManager.ServerCertificateValidationCallback并使其始终返回true,未解决问题
  • 将注册表中的"SchUseStrongCrypto"标志设置为"1",无效(设置界面截图:SchUseStrongCrypto标志设置截图)

内容的提问来源于stack exchange,提问作者Max22

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 11:05:55