. net安全协议TLS

本文关键字:TLS 协议 安全 net | 更新日期: 2023-09-27 18:14:50

我有一个. net应用程序,它在我们的测试和生产环境中与SOAP web服务交互。测试环境需要TLS 1.1或更高版本,而生产环境仍然支持TLS 1.0。

我添加了以下代码:

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 |    
                                                   SecurityProtocolType.Tls11 | 
                                                   SecurityProtocolType.Tls;
有没有人知道如果上面的代码片段将工作在测试和生产环境通过使用支持的加密协议?由于

. net安全协议TLS

答案取决于你的。net版本。如果你安装了。net 4.5,即使你的代码是在4.0下编译的,它也能工作。

如果你没有安装4.5+,它将无法工作。详见http://blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/