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

标签 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

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

A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 70. The Windows SChannel error state is 105.

如果我只为 TLS 1.0 恢复注册表设置(已启用,而不是 DisabledByDefault),一切都会恢复正常。

在 system.web 中使用:

<httpRuntime targetFramework="4.7.2" />

我错过了什么?

最佳答案

应用程序本身必须更新以支持 TLS 1.2 握手,因此如果您只能访问配置,则不必更改它。如果底层代码不支持,就不行。

如果代码以 .NET 4.6 为目标,我相信 TLS 1.2 将在 native 工作。在 4.5 中,必须放置一行代码,以便在任何网络发生之前执行它。代码:

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12

关于asp.net - 禁用 TLS 1.0 会破坏 ASP.NET 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50338640/

相关文章:

coldfusion - 带有 ColdFusion 10/11 的 IIS 8/8.5 上的错误 500

c# - 在现有 MVC5 Azure WebApp 中添加其他项目(博客引擎)

jquery - 如何覆盖/扩展 javascript 处理程序?

asp.net - 在asp.net mvc中获取在线用户列表

c# - 如何从母版页代码页获取应用程序路径?

升级部署后,Azure 中的 IIS 应用程序初始化定期显示 500

node.js - https ssl/tls 无法在 Nodejs 中的 localhost 上工作

c++ - 错误 : cannot convert ‘std::string’ to ‘X509*’ for argument ‘1’ to ‘EVP_PKEY* X509_get_pubkey(X509*)’

php - 如何使用 SSL 向客户端发送安全数据

windows - 如何通过代码安装 IIS 8