详情页

宝塔https部署后没成功与TLS版本要大于等于1.2的解决办法

时间:2022年11月28日

编辑:佚名

如果你的网站是首次通过宝塔控制面板申请的SSL证书,出现部署成功后打开HTTPS的网址却无法访问的情况,那么请检查以下三项可能:
宝塔SSL证书部署
宝塔SSL证书部署
1、检查你的云服务器安全组,有没有在安全组策略中将443端口添加进去,特别是阿里云的服务器。
2、检查宝塔面板中的安全防火墙的443端口有没有放行。
宝塔放行端口
宝塔放行端口
3、如果之前有装过加密证书的话,比如:comodo,网站的根目录有一个ssl文件夹,这个是放加密证书的,里面有四个文件:.crt文件、.csr文件、.key文件和ssl.pfx文件,把这些文件重命名,或者直接把ssl文件夹重命名,比如ytkah直接把它重命名为ssl##。再清除浏览器缓存,访问https的站点看下是否已正常。
接下来是部署成功后chrome浏览器访问提示您的链接不是私密链接,详情是TLS 1.0、1.1版本将过期,这时我们要升级成1.2版本,但你要先看下当前的系统环境是否支持TLS1.2以上,可以参考一下表格:
系统环境所支持的TLS版本
系统环境所支持的TLS版本
请先确认系统支持TLS1.2以后,进行下一步操作,如果不支持请升级系统到支持版本。windows2008R2在配置SSL做小程序开发时候提示小程序的TLS版本必须大于等于1.2。
这里可以进行SSL服务器测试,点击:SSL Server Test
解决方法:
请先备份导出HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols的值。如图:
注册表备份SSL文件
注册表备份SSL文件
SSL.txt:
Windows Registry Editor Version 5.00  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello]  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Client]  
"Enabled"=dword:00000000  
"DisabledByDefault"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Server]  
"Enabled"=dword:00000000  
"DisabledByDefault"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0]  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Client]  
"Enabled"=dword:00000000  
"DisabledByDefault"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Server]  
"Enabled"=dword:00000000  
"DisabledByDefault"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0]  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client]  
"DisabledByDefault"=dword:00000001  
"Enabled"=dword:00000000  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server]  
"Enabled"=dword:00000000  
"DisabledByDefault"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0]  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client]  
"Enabled"=dword:00000000  
"DisabledByDefault"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server]  
"Enabled"=dword:00000000  
"DisabledByDefault"=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:00000001  
"DisabledByDefault"=dword:00000000  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server]  
"Enabled"=dword:00000001  
"DisabledByDefault"=dword:00000000  
[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]  
"DisabledByDefault"=dword:00000000  
"Enabled"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server]  
"DisabledByDefault"=dword:00000000  
"Enabled"=dword:00000001  
[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]  
"DisabledByDefault"=dword:00000000  
"Enabled"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]  
"Enabled"=dword:00000001  
"DisabledByDefault"=dword:00000000
请下载上方的.txt,文档里包含了代码,然后修改文件名后缀为.reg,双击执行即可,完成这一步后,重启服务器完成更新。(备注:为了防止有意外情况发生,最好完整的备份一份注册表放在桌面)
相关文章
猜你需要