【问题标题】:Xcode BoringSSL peer disconnect causing app to hang on startupXcode BoringSSL 对等断开导致应用程序在启动时挂起
【发布时间】:2019-12-21 05:37:05
【问题描述】:

最近我开始遇到不一致的 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 

【问题讨论】:

    标签: ios xcode cordova google-cloud-platform boringssl


    【解决方案1】:

    我被这个错误困住了,我所做的是在 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

    【讨论】:

    • 我的问题已经平息了很多,就在我修复 [Fabric] 问题的时候,然后我意识到该问题与 Firebase Crashlytics 有关。但是,我仍然不时收到错误...以前就像我每 3 次或第 4 次将应用程序从 Xcode 编译到我的物理测试设备一样。现在它大约每 15 到 20 次编译发生一次。我不知道新的崩溃是否相关。
    • 是的,这正是发生在我身上的事情。在这个“修复”之后,我测试了 50 次,没有出现错误。不知道是否有更好的方法,但做了我需要的。
    • 嘿,@rolinger,你能试试我上次编辑的建议吗?很高兴看看它是否也能解决您的问题。
    • 我会在解决当前一批 iOS 问题后解决。我的项目是一个 Ionic v1 应用程序,我刚刚将 cli 从 v1.7.14 升级到 v5.2.6 - 在 Android 上一切正常,但在 iOS 上却出现各种问题。最大的一个是 ionic cordova build iOS 只是在 Preparing Firebase on iOS 处干净地退出 - 没有问题或错误,但它无法实际构建,事实上 platforms/ios/build 目录永远不会被创建。
    • 有 firebasex 和 ionic 它现在已解决。回去尝试找出这些无聊的问题 - 我启用了 firebase crashlytics 并修复了结构问题,但仍然收到了无聊的警告。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-14
    • 1970-01-01
    • 2012-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-02
    相关资源
    最近更新 更多