微信小程序服务器连接失败,微信小程序在苹果上出现[request:fail 发生了 SSL 错误无法建立与该服务器的安全连接。]错误的解决方案...

由于原本的服务器出故障,在使用临时服务器的时候出现苹果无法加载小程序 出现

request:fail 发生了 SSL 错误无法建立与该服务器的安全连接。的问题

ba8128d0eecaede331fd620bf1abca7f.png

问题原因:

2017年1月1日起,苹果强制所有 app 满足 HTTPS,即 iOS9 推出的 App Transport Security (ATS) 特性。

输入域名,通过苹果ATS检测发现临时服务器并不支持TSL1.2,不满足ATS特性,所以需要配置服务器,打开TSL1.2

解决步骤:

1.运行regedit打开注册表

2.启用TLS1.2

进入[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]

找到TL2 1.1 和TLS 1.2 将里面Server和Client两项的值均改为

DisabledByDefault [值 = 0]

Enabled [值 = 1]

如果没有TLS1.1,TLS 1.2就新建

右键->新建->项->新建TLS 1.1,TLS 1.2

TLS 1.1和TLS 1.2 右键->新建->项->新建Server, Client

在新建的Server和Client中都新建如下的项(DWORD 32位值), 总共4个

e9d037ac7cbda9a207dbc94a2546c5df.png

3.禁用SSL2.0

将SSL 2.0->Client中的值均改为0

DisabledByDefault [值 = 0]

Enabled [值 = 0]

cbb9c770714eea8792167fe4ccd66388.png

上面是手动更改注册表的方法。

也可以将以下代码新建文本文件, 后缀名改为.reg,然后双击自动导入

1 Windows Registry Editor Version 5.00

2 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]3 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0]4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client]5 "DisabledByDefault"=dword:00000000

6 "Enabled"=dword:00000000

7 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2]8 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]9 "DisabledByDefault"=dword:00000000

10 "Enabled"=dword:00000001

11 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]12 "DisabledByDefault"=dword:00000000

13 "Enabled"=dword:00000001

14 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1]15 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client]16 "DisabledByDefault"=dword:00000000

17 "Enabled"=dword:00000001

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

20 "Enabled"=dword:00000001

最后重启服务器,再进行域名检测

40b639c08b43bf1efddcb9514d83cad7.png

检测结果成功便可以正确访问小程序了。

原文:https://www.cnblogs.com/cokolxvd/p/11540825.html