我的BranchSDK有问题,在初始化过程中我收到错误:12-28 13:50:22.203 D/FirebasePerformance: Logging NetworkRequestMetric - [https://api2.branch.io/v1/install](https://api2.branch.io/v1/install) 0b 1136ms, 12-28 13:50:22.204 I/FirebasePerformance: Did not receive a HTTP Response Code 12-28 13:50:22.204 W/FirebasePerformance: Unable to process the PerfMetric due to missing or invalid values. See earlier log statements for additional information on the specific missing/invalid values. 12-28 13:50:22.208 E/BranchNetworkClient: Error in doRestfulGet( [https://api2.branch.io/v1/install](https://api2.branch.io/v1/install) ) javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x63395a88: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5d9ce808:0x00000000) at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:449) at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:318) at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:282) at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:167) at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257) at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135) at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall.execute(RealCall.java:77) at com.google.firebase.perf.network.FirebasePerfOkHttpClient.execute(Unknown Source) at com.riversoft.eventssion.network.BranchNetworkClient.doRestfulPost(BranchNetworkClient.java:59) at io.branch.referral.network.BranchRemoteInterface.make_restful_post(BranchRemoteInterface.java:136) at io.branch.referral.Branch$BranchPostTask.doInBackground(Branch.java:2860) at io.branch.referral.Branch$BranchPostTask.doInBackground(Branch.java:2835) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x63395a88: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5d9ce808:0x00000000) at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method) at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:406) ... 29 more
我试过:https://github.com/BranchMetrics/android-branch-deep-linking/issues/552和:
ConnectionSpec spec = new
ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(TlsVersion.TLS_1_2)
.cipherSuites(
CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256)
.build();
OkHttpClient client = new OkHttpClient.Builder()
.connectionSpecs(Collections.singletonList(spec))
.build();
P.S.这是API19上的问题,但API 28,27,25,23都工作得很好。
4条答案
按热度按时间jyztefdp1#
请确认您正在使用的SDK版本?因为我们最新的SDK版本有一些TLS相关的更改。
请参阅:https://github.com/BranchMetrics/android-branch-deep-linking/releases
其中3.0.0版有一些与TLS相关的更改。如果问题仍然存在,请更新分支SDK并写信至integrations@branch.io。
谢谢。
kq4fsx7k2#
对于3.0.3及以下版本,帮助我在初始化BranchSDK时只添加了一个字符串:
ProviderInstaller.installIfNeeded(context);
mnowg1ta3#
在basapplicationoncreate方法上添加此行
368yc8dk4#
对于React Native Expo IOS(
react-native-branch@5.4.0
,@config-plugins/react-native-branch@5.0.0
,expo@48.0.10
),只需确保实现在官方文档中,它使用
但是它在我的环境中抛出了
use of undeclared identifier 'app'
错误。我不得不将app
改为application
来强制执行这项工作。