Hi,
My app was working great and used to get data from TMDB.However, from past few days, I am unable to fetch the data.
Platform : Android Device : Moto G3
Getting the following log:
Get: https://api.themoviedb.org/3/movie/now_playing?api_key=${KEY}&page=1
HTTP FAILED: javax.net.ssl.SSLHandshakeException: Connection closed by peer
Complete logs:
javax.net.ssl.SSLHandshakeException: Connection closed by peer
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:324)
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.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:213)
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 retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:42)
at io.reactivex.Observable.subscribe(Observable.java:12030)
at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34)
at io.reactivex.Observable.subscribe(Observable.java:12030)
at io.reactivex.internal.operators.observable.ObservableObserveOn.subscribeActual(ObservableObserveOn.java:45)
at io.reactivex.Observable.subscribe(Observable.java:12030)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:579)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة Travis Bell
بتاريخ مايو 5, 2019 في 1:08 مساءا
What version of TLS are you using? I suggest trying to make sure you are connecting over at least TLS 1.1 (but preferably TLS 1.2) and let me know if the problem is fixed.
رد بواسطة RKing
بتاريخ مايو 8, 2019 في 9:18 مساءا
@travisbell I am getting the same error. Tried with TLS 1.1 and 1.2 as well.
Android + OkHttp + Retrofit
رد بواسطة Travis Bell
بتاريخ مايو 8, 2019 في 9:26 مساءا
Ok, that's about all I had to suggest.
I don't know anything about OkHttp or Retrofit. I might suggest posting over on Stack Overflow as that's more of a programming board and have some users familiar with the technology.
رد بواسطة RKing
بتاريخ مايو 8, 2019 في 9:27 مساءا
Ohk @travisbell . Thanks for the support. I will post on StackOverflow.
رد بواسطة RKing
بتاريخ أغسطس 25, 2019 في 2:55 مساءا
Hi @travisbell , I am unable to connect to the server still from Android devices. I tried finding the solution it states the backend to update the certificates. Please look into the same.
رد بواسطة Travis Bell
بتاريخ أغسطس 26, 2019 في 5:03 مساءا
What version of Android are you using? I believe for Android 4.4 and earlier you will need to do some custom work to be able to connect to TLS 1.1 or higher. Here's an article that discusses this a bit: https://medium.com/tech-quizlet/working-with-tls-1-2-on-android-4-4-and-lower-f4f5205629a
رد بواسطة RKing
بتاريخ أغسطس 26, 2019 في 9:46 مساءا
I am using Android 6.0, Marshmallow.
However, I have tried making customisations earlier for TLS, but it didn't work.
Most threads on stackoverflow states that backed needs to update the SSL certificates in such scenarios.
رد بواسطة RKing
بتاريخ سبتمبر 23, 2019 في 7:34 صباحا
Hi @travisbell ,
The APIs are working now. No more SSL Handshake Exceptions for me. P.S: There was no change made from my side (for android).
رد بواسطة Travis Bell
بتاريخ سبتمبر 24, 2019 في 4:03 مساءا
Hey @RKing I haven't made any changes and TLS 1.1 minimum is still required. Not sure what changed...