微信小程序在蘋果上出現[request:fail 發生了 SSL 錯誤無法建立與該服務器的安全連接。]錯誤的解決方案


由於原本的服務器出故障,在使用臨時服務器的時候出現蘋果無法加載小程序 出現

request:fail 發生了 SSL 錯誤無法建立與該服務器的安全連接。的問題

問題原因:

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

輸入域名,通過蘋果ATS檢測發現臨時服務器並不支持TSL1.2,不滿足ATS特性,所以需要配置服務器,打開TSL1.2

域名檢測網址:http://s.tool.chinaz.com/ats/

解決步驟:

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個

3.禁用SSL2.0

將SSL 2.0->Client中的值均改為0

DisabledByDefault [值 = 0]

Enabled [值 = 0]

 

 

上面是手動更改注冊表的方法。

也可以將以下代碼新建文本文件, 后綴名改為.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

 最后重啟服務器,再進行域名檢測

 

檢測結果成功便可以正確訪問小程序了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM