2

最近我开始遇到不一致的 BoringSSL 问题,导致我的 cordova/ionic 应用程序挂起。在我将应用程序从 Xcode 启动到物理连接的测试 iPhone 6 时,大约每 4 或 5 次就会发生这种情况。测试手机仅使用 WiFi(无运营商网络)。有时间找到任何可靠的解决方案或问题的根源是什么。

一些表示它的 DNS,另一些表示它与 Firebase 相关......我已经尝试了这些线程提到的一些修复,但没有一个对我有用。

[BoringSSL] nw_protocol_boringssl_input_finished(1543) [C3.1:2][0x12fd335c0] Peer disconnected during the middle of a handshake. Sending errSSLClosedNoNotify(-9816) alert
TIC TCP Conn Failed [3:0x2805712c0]: 3:-9816 Err(-9816)
[BoringSSL] nw_protocol_boringssl_input_finished(1543) [C5.1:2][0x12fe46470] Peer disconnected during the middle of a handshake. Sending errSSLClosedNoNotify(-9816) alert
TIC TCP Conn Failed [5:0x280575f80]: 3:-9816 Err(-9816)
[BoringSSL] boringssl_context_alert_callback_handler(3724) [C6.1:2][0x12fd43710] Alert level: fatal, description: inappropriate fallback
[BoringSSL] boringssl_session_errorlog(224) [C6.1:2][0x12fd43710] [boringssl_session_handshake_incomplete] SSL_ERROR_SSL(1): operation failed within the library
[BoringSSL] boringssl_session_handshake_error_print(205) [C6.1:2][0x12fd43710] 5097281768:error:1000043e:SSL routines:OPENSSL_internal:TLSV1_ALERT_INAPPROPRIATE_FALLBACK:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.250.2/ssl/tls_record.cc:586:SSL alert number 86
[BoringSSL] boringssl_context_get_error_code(3617) [C6.1:2][0x12fd43710] SSL_AD_INAPPROPRIATE_FALLBACK
TIC TCP Conn Failed [6:0x280576640]: 3:-9860 Err(-9860)
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9860)
Task <02ADA890-35C5-4DE7-B0E5-6EC812CF79E6>.<1> HTTP load failed (error code: -1200 [3:-9860])
Task <02ADA890-35C5-4DE7-B0E5-6EC812CF79E6>.<1> finished with error - code: -1200
nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x12fe15ea0] get output frames failed, state 8196
nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x12fe15ea0] get output frames failed, state 8196

如果应用程序在初始化时看到此错误,则应用程序会在初始屏幕上挂起。如果它解决了这个问题,那么该应用程序就可以正常工作,我只是nw_protocol_get_output_frames经常看到消息(也不知道这些消息是关于什么的)。

任何人对造成这种情况的原因、在哪里寻找或可能的修复方法有任何想法?

Cordova CLI: 9.0.0 (cordova-lib@9.0.1)
cordova-ios: v5.0.0
Gulp version:  CLI version 3.9.1
Gulp local:  
Ionic Framework Version: 1.3.4
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
ios-deploy version: 1.9.4 
ios-sim version: 8.0.1 
OS: Mac OS X El Capitan
Node Version: v6.11.4
Xcode version: Xcode 10.1 Build version 10B61 
4

1 回答 1

0

我被这个错误困住了,我所做的是在 XCode 上启用各种日志,这表明这个 BoringSSL 的错误来自对谷歌 API Crashlytics 的调用。解决这个问题的方法是进入 firebase,为我的项目启用 crashlytics,安装插件(https://ionicframework.com/docs/native/firebase-crashlytics)并初始化它。

要在 firebase 上查找 crashlytics,您可以在控制台输入并在左侧的菜单质量下搜索 crashlytics。之后,如果您的应用程序中已经有了 GoogleService-Info.plist,剩下的就是安装插件并根据文档对其进行初始化。

[编辑] 不知道以上内容是否有帮助,因为在另一批测试中我发现它没有解决问题。但是当我将下一行添加到 config.plist 时,它会解决:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>app-measurement.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>mtalk.google.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>play.googleapis.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>settings.crashlytics.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>googleapis.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>localhost</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
        <key>127.0.0.1</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <false/>
</dict>

https://forums.developer.apple.com/thread/42555 https://cocoacasts.com/app-transport-security-has-blocked-my-request

于 2019-08-27T22:46:50.513 回答