TLSv1.2 protocol on android 4.* <

2

I'm using okhttp v 2.4.0 with retrofit v1.9.0 to make https request where the server uses Protocol TLSv1.2 only, and I'm getting the error:

javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8e6cf68: 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:741 0x971fb990:0x00000000)
  at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
  at com.squareup.okhttp.internal.http.SocketConnector.connectTls(SocketConnector.java:103)
  at com.squareup.okhttp.Connection.connect(Connection.java:143)
  at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:185)
  at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
  at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
  at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
  at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
  at com.squareup.okhttp.Call.getResponse(Call.java:273)
  at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230)
  at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201)
  at com.squareup.okhttp.Call.execute(Call.java:81)
  at retrofit.client.OkClient.execute(OkClient.java:53)
  at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326)
  at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
  at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
  at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at retrofit.Platform$Android$2$1.run(Platform.java:142)
  at java.lang.Thread.run(Thread.java:841)
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8e6cf68: 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:741 0x971fb990:0x00000000)
  at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
  at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)

I tried a lot of things from here, but nothing works, I try to set the protocol with SocketFactory as showed here:

It worked when the server supported TLSv1, TLSv1.1, TLSv1.2, SSLv3, but when it was removed and let only TLSv1.2 it stop working, so I try to use the class NoSSLv3Factory as sad in many answer here in stackoverflow, but no success either, the NoSSLv3 approach I used is that one: How to disable SSLv3 in android for HttpsUrlConnection?

The thing I can't undestand is why I keep getting the SSLv3 error if the server doesn't use that protocol anymore and I'm removing it from okhttp client, and why it doesn't work on Android 4.4.2 if the site: https://www.ssllabs.com/ssltest says that is the same for 4.4.2+ as shown on image

enter image description here

If anyone have any idea, I could use some help on that

android
https
retrofit
network-protocols
okhttp
asked on Stack Overflow Aug 23, 2016 by tiagoMissiato • edited Oct 6, 2019 by Dor

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0