.NET 4.5和.NET 4.5.1默认情况下是否启用TLS 1.1和TLS 1.2? [英] Is TLS 1.1 and TLS 1.2 enabled by default for .NET 4.5 and .NET 4.5.1?

查看:653
本文介绍了.NET 4.5和.NET 4.5.1默认情况下是否启用TLS 1.1和TLS 1.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 2012 Server R2上,我们需要禁用TLS 1.0。

On our Windows 2012 Server R2, we need to disabled TLS 1.0.

但是我们正在运行.NET 4.5 Wcf服务。我们发现,如果禁用TLS 1.0,则WCF服务将不再运行,因为会出现错误现有连接已被远程主机强行关闭。

However we have .NET 4.5 Wcf services running. We found that if we disable TLS 1.0 that the WCF services no longer run, as we get the error 'An existing connection was forcibly closed by the remote host'.

.NET 4.5和.NET 4.5.1默认情况下是否启用TLS 1.1 / 1.2?如果不是这样,我们假设是这样,在WCF项目中,我们是否强制项目使用TLS 1.1 / 1.2?

Is TLS 1.1/1.2 enabled by default in .NET 4.5 and .NET 4.5.1 ? If not, which we assume is the case, where in our WCF project do we force the project to use TLS 1.1/1.2 ?

推荐答案

否。为各种框架版本启用的默认协议为:

No. The default protocols enabled for the various framework versions are:


  • .NET Framework 4.5和4.5.1:SSLv3和TLSv1

  • .NET Framework 4.5.2:SSLv3,TLSv1和TLSv1.1

  • .NET Framework 4.6及更高版本:TLSv1,TLSv1.1和TLS1.2

来源: [1] [2]

您可以使用 ServicePointManager 类指定应用程序支持的协议,特别是通过设置 SecurityProtocol 属性,在您的情况下,您需要将其设置为以下内容:

You can specify which protocols your application supports by using the ServicePointManager class, specifically by setting the SecurityProtocol property, which in your case you would want to set to the following:

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

这篇关于.NET 4.5和.NET 4.5.1默认情况下是否启用TLS 1.1和TLS 1.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆