【发布时间】:2018-04-06 08:26:20
【问题描述】:
我正在尝试使用 .Net 4.5.2 将 Salesforce 与 .Net API 集成。我在具有 Windows 2008 R2 的服务器上运行的 API 并且我检查了 Internet 属性 TLS 1.2 也被检查了我已经从 this link 进行了检查,我得到了 Probably Ok 回来。这意味着我的服务器中确实启用了 TLS 1.2。
在 .Net API 中我添加了下面的代码
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
当我尝试连接时出现以下错误
The request was aborted: Could not create SSL/TLS secure channel.
为了进行测试,我开始使用 ASP.net web 与此 API 集成,但我确实遇到了同样的错误,但如果我更改上面的代码以允许所有协议
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
我没有收到任何错误,我可以连接到我的 API。这解释了我的服务器无法在 TLS 1.2 上建立连接。我在这里错过了什么?
【问题讨论】:
标签: asp.net ssl .net-4.5 tls1.2