ios - Xcode BoringSSL peer disconnect 导致应用程序在启动时挂起

标签 ios xcode cordova google-cloud-platform boringssl

最近我开始遇到导致我的 cordova/ionic 应用挂起的 BoringSSL 不一致问题。我将应用程序从 Xcode 启动到物理连接的测试 iPhone 6 时,每 4 或 5 次中就有 1 次发生这种情况。测试手机仅使用 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 

最佳答案

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

关于ios - Xcode BoringSSL peer disconnect 导致应用程序在启动时挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57498474/

相关文章:

iphone - 将图像发送到服务器后出现错误 - "Corrupt JPEG data: 214 extraneous bytes before marker"

xcode - fatal error : unexpectedly found nil while unwrapping an Optional value swift error

cordova - PhoneGap 桥接移动平台

iphone - 未调用 UITextView textViewShouldEndEditing/textViewDidEndEditing

ios - swift 5 : Non-terrible solutions for sharing of JSON Key-values for Codable Structs?

IOS 状态栏 LigthContent

xcode - Xcode 中已存在同名项目

ios - 链接库但 Xcode 显示 "file not found."

javascript - window.plugin.pushNotification 在 Cordova 3.6.4 上未定义

javascript - 如何在 Eclipse 中使用 Phonegap 在移动目录中创建简单的文本文件