如何在Windows Server2012系统下关闭TLS1.0/1.1?
美国、香港服务器
如何在Windows Server2012系统下关闭TLS1.0/1.1?
09-14 来源:
## 方案 1:PowerShell 一键脚本
# 关闭 TLS 1.0
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" -Name "Enabled" -Value 0 -PropertyType DWord -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" -Name "DisabledByDefault" -Value 1 -PropertyType DWord -Force
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client" -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client" -Name "Enabled" -Value 0 -PropertyType DWord -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client" -Name "DisabledByDefault" -Value 1 -PropertyType DWord -Force
# 关闭 TLS 1.1
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" -Name "Enabled" -Value 0 -PropertyType DWord -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" -Name "DisabledByDefault" -Value 1 -PropertyType DWord -Force
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" -Name "Enabled" -Value 0 -PropertyType DWord -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" -Name "DisabledByDefault" -Value 1 -PropertyType DWord -Force
脚本执行完毕,**重启服务器**,配置正式生效。
## 方案 2:注册表手动操作(regedit 图形界面)
1. Win+R,输入`regedit`打开注册表编辑器
2. 定位路径:
`HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols`
3. 依次处理 `TLS 1.0` 和 `TLS 1.1`:
- 新建项 `TLS 1.0`,其下新建两个子项 `Server`、`Client`
- 在 Server、Client 里面分别新建 **DWORD (32 位) 值**
- `Enabled` = `0`
- `DisabledByDefault` = `1`
- TLS1.1 完全重复上面操作
4. 重启服务器。
## 方案 3:IIS Crypto 可视化工具(最简单,不容易出错)
1. 下载 IIS Crypto 工具;
2. 打开工具,取消勾选:TLS 1.0、TLS1.1、SSL3.0;
3. 确认勾选 TLS1.2;
4. 点【Apply】,重启服务器。
验证是否生效
服务器重启后,使用 SSL 在线检测工具访问网站,协议列表**只保留 TLS1.2**,TLS1.0/1.1 不再协商成功。
CDN 场景重要注意事项
1. 如果你的架构是 **CDN 侧 HTTPS,回源 HTTP(80 端口)**:
源站 IIS 不处理 HTTPS 握手,关闭 TLS1.0/1.1 对业务**无任何影响**,推荐直接关闭消除高危漏洞。
2. 如果是 **HTTPS 回源 443**:
CDN 节点全部支持 TLS1.2,关闭旧协议不会影响 CDN 回源。
3. 风险点:服务器上**老旧程序、第三方 API 对接**,如果对方接口只支持 TLS1.0/1.1,服务器出站请求会失败;现代接口基本都支持 TLS1.2。
## 回滚方案(万一业务异常)
把对应 TLS1.0/1.1 的 `Enabled` 值改为`1`,`DisabledByDefault`改为`0`,重启服务器即可恢复旧协议。
## 补充:顺带关闭 SSL3.0(推荐一起加固)
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server" -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server" -Name "Enabled" -Value 0 -PropertyType DWord -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server" -Name "DisabledByDefault" -Value 1 -PropertyType DWord -Force
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client" -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client" -Name "Enabled" -Value 0 -PropertyType DWord -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client" -Name "DisabledByDefault" -Value 1 -PropertyType DWord -Force
三二互联专业提供香港VPS,美国VPS主机,香港云服务器租用等业务香港美国到大陆CN2 GIA速度最快