我目前有一个使用.NET 3.5框架的web应用程序,我想知道它是否与TLS1.2兼容。不,在我们的代码中,我们要听写TLS版本。这是一个遗留应用程序,现在还没有重新编译。我没有找到多少信息,你是否可以或不能,但我的印象是兼容性更依赖于操作系统版本。看起来最低值是2008年的R2。我们的目标是让paypal能够在7月1日进行适当的沟通。
发布于 2017-04-05 20:06:28
从文档中可以看到,TLS1.2不在SslProtocols
的枚举中,而是添加到.NET 4.5中的枚举中(谢谢@orhun)。
.NET 3.5上的TLS1.2兼容性没有解决办法。
不幸的是,为了获得TLS1.2的兼容性,您必须升级到.NET 4.5或更高版本。
编辑10/11/17
我的上述答案已不再准确。2017年5月,微软发布了一个软件包,允许.NET 3.5.1中的TLS 1.2。
发布于 2017-07-03 20:42:08
如前所述,.net 3.5.1现在支持TLS1.2;但是您不需要@Paulina的答复中提到的注册表更改。
我在.net 3.5.30729.4926中使用VS 2008。我要做的就是:
增加进口:
Imports System.Security.Authentication
Imports System.Net
将其添加到我的代码(C#)中:
public const SslProtocols _Tls12 = (SslProtocols)0x00000C00;
public const SecurityProtocolType Tls12 = (SecurityProtocolType)_Tls12;
ServicePointManager.SecurityProtocol = Tls12
VB.net版本:
Const _Tls12 As SslProtocols = DirectCast(&HC00, SslProtocols)
Const Tls12 As SecurityProtocolType = DirectCast(_Tls12, SecurityProtocolType)
ServicePointManager.SecurityProtocol = Tls12
选自:https://support.microsoft.com/en-us/help/3154518/support-for-tls-system-default-versions-included-in-the-.net-framework注释:通过在我的代码中定义const,我可以忽略本文中的其他所有内容,包括注册表编辑和cs文件。
发布于 2017-05-16 14:28:22
您可以让TLS 1.2与Framework3.5一起工作。
微软已经发布了它的更新。
按照以下步骤执行
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v2.0.50727
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft.NETFramework\v2.0.50727
1. Add entry to registry keys
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v2.0.50727 "SystemDefaultTlsVersions"=dword:00000001
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft.NETFramework\v2.0.50727 "SystemDefaultTlsVersions"=dword:00000001
1. Add code to your project as specified in the link - Developer Guidance section
我应用了这个解决方案,它对我有效。
https://stackoverflow.com/questions/43240611
复制相似问题