禁用TLS 1.0会破坏ASP.NET应用程序

Cad*_*oux 10 asp.net ssl iis-8 windows-server-2012-r2

在Windows Server 2012R2上运行

我试图在IIS上禁用TLS 1.0,因为客户端有一个站点扫描程序,突出显示这是一个安全问题.

我有一个干净的测试服务器设置和应用程序正常运行,直到我禁用TLS 1.0.

我更新了所有适当的设置:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client]
"Enabled"=dword:ffffffff
"DisabledByDefault"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server]
"Enabled"=dword:ffffffff
"DisabledByDefault"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"Enabled"=dword:ffffffff
"DisabledByDefault"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
"Enabled"=dword:ffffffff
"DisabledByDefault"=dword:00000000
Run Code Online (Sandbox Code Playgroud)

在事件查看器中,我得到:

生成致命警报并将其发送到远程端点.这可能导致连接终止.TLS协议定义的致命错误代码为70.Windows SChannel错误状态为105.

如果我还原TLS 1.0(启用,而不是DisabledByDefault)的注册表设置,一切都很好.

在system.web中使用:

<httpRuntime targetFramework="4.7.2" />
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

小智 6

必须更新应用程序本身以支持TLS 1.2握手,因此如果您只能访问配置,则不一定要更改.如果底层代码不支持它,它将无法工作.

如果代码的目标是.NET 4.6,我相信,TLS 1.2将在本机上运行.在4.5中,必须放置一行代码,以便在任何网络发生之前执行.代码:

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
Run Code Online (Sandbox Code Playgroud)


C.M*_*.M. 4

您的站点可能正在通过 SSL 与不支持 TLS 1.1+ 的设备进行通信。您可以允许站点扫描程序看不到的传出 TLS 1.0 连接,但这些连接的安全性会降低。