民审-M

小程序调试时提示:小程序要求的TLS版本必须大于等于1.2错误提示的解决办法

作者:民审-M   发布时间:2018-03-13 10:07   回复数:0   浏览数:412
民审-M
4120民审-M金牌草根
2018-03-13 10:07:53
4120 2018-03-13 10:07:53
小程序调试时提示:小程序要求的TLS版本必须大于等于1.2错误提示的解决办法,适应于WINDOWS系统
此问题最近在微信小程序开发中,比较常见。

错误提示截图:

图片:小程序调试时提示-1.jpg



在解决这个问题之前,我们需要了解一下,当前的系统环境是否支持TLS1.2以上,可以参考一下表格:

图片:小程序调试时提示-2.jpg



解决方法:

打开PowerShell

图片:小程序调试时提示-3.jpg



将以下代码复制到PowerShell运行窗口中执行,后重启服务器即可# Enables TLS 1.2 on windows Server 2008 R2 and Windows 7

# These keys do not exist so they need to be created prior to setting values.
md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\"
md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server\"
md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client\"

# Enable TLS 1.2 for client and server SCHANNEL communications
new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server\" -name \"Enabled\" -value 1 -PropertyType \"DWord\"
new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server\" -name \"DisabledByDefault\" -value 0 -PropertyType \"DWord\"
new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client\" -name \"Enabled\" -value 1 -PropertyType \"DWord\"
new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client\" -name \"DisabledByDefault\" -value 0 -PropertyType \"DWord\"

# Disable SSL 2.0 (PCI Compliance)
md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server\"
new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server\" -name Enabled -value 0 -PropertyType \"DWord\"
# Enables TLS 1.2 on Windows Server 2008 R2 and Windows 7 # These keys do not exist so they need to be created prior to setting values. md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\" md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server\" md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client\" # Enable TLS 1.2 for client and server SCHANNEL communications new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server\" -name \"Enabled\" -value 1 -PropertyType \"DWord\" new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server\" -name \"DisabledByDefault\" -value 0 -PropertyType \"DWord\" new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client\" -name \"Enabled\" -value 1 -PropertyType \"DWord\" new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client\" -name \"DisabledByDefault\" -value 0 -PropertyType \"DWord\" # Disable SSL 2.0 (PCI Compliance) md \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server\" new-itemproperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server\" -name Enabled -value 0 -PropertyType \"DWord\"


或将以下附件上传服务器,双击运行

TLS版本必须大于等于1.2错误解决办法.rar.rar
游客
登录后才可以回帖,登录 或者 注册