javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for

 解决方案:忽略证书认证。

javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:231)

 at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.kt:351)

at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.kt:310)

at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:178)

at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:236)

at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:109)at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:77)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.kt:162)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:35)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
com.p3group.bmw.data.api.ApiInterceptorModule.lambda$provideHeaderInterceptor$0(ApiInterceptorModule.java:64)
com.p3group.bmw.data.api.-$$Lambda$ApiInterceptorModule$nWX8NKkH-kfad4KMdskp_x8w9to.intercept(Unknown Source:6)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:215)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
com.networkbench.agent.impl.i.b.intercept(SourceFile:69)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
okhttp3.RealCall.execute(RealCall.kt:66)
retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
com.jakewharton.retrofit2.adapter.rxjava2.CallObservable.subscribeActual(CallObservable.java:41)
io.reactivex.Observable.subscribe(Observable.java:12284)
io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
java.lang.Thread.run(Thread.java:929)
 Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
com.android.org.conscrypt.TrustManagerImpl.verifyChain(TrustManagerImpl.java:674)
com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:551)
com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:617)
com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:507)
com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:426)
 com.android.org.conscrypt.TrustManagerImpl.getTrustedChainForServer(TrustManagerImpl.java:354)
 at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:94)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:89)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:224)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at com.android.org.conscrypt.ConscryptFileDescriptorSocket.verifyCertificateChain(ConscryptFileDescriptorSocket.java:407)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at com.android.org.conscrypt.NativeSsl.doHandshake(NativeSsl.java:387)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:226)
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     ... 43 more
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter: Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
2020-07-22 10:48:42.371 17140-17140/com.p3group.bmw E/TestDriveMainPresenter:     ... 56 more

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值