![](/img/trans.png)
[英]"Run as Administrator" (System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.)
[英]The request was aborted: Could not create SSL/TLS secure channel. | System.Net.WebException
我的webApi在其中使用了第三方Web api服务。 关键是它可以在我的本地计算机和Azure Web Service中完美运行。 但是,当我将此解决方案转移到Azure Vm实例时,出现此错误。 我已经安装了与该第三方网络api相关的正确证书,并已在HttpClient中注册,并尝试使用
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
但是它给出了同样的错误。 我不知道确切的错误是什么。 请问有人可以帮忙吗?
据我了解,您可以参考以下方法来检查此问题:
1.利用https://www.ssllabs.com/ssltest/来检查您自己和第三方Web API上支持的协议,如下所示:
2.按如下所示配置SecurityProtocol
和ServerCertificateValidationCallback
:
ServicePointManager.Expect100Continue = true;
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.