I am using Retrofit for networking in my app. App works fine in devices with os version greater than 4.4 but throws javax.net.ssl.SSLHandshakeException in emulator with os version 4.4(API 19). Here is my Retrofit configuration
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
final OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(180, TimeUnit.SECONDS)
.connectTimeout(180, TimeUnit.SECONDS)
.addInterceptor(logging)
.build();
final Retrofit retrofit = new Retrofit.Builder().baseUrl(BuildConfig.BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(okHttpClient)
.build();
mListener = retrofit.create(ApiListener.class);
Here is my exception log
D/OkHttp: <-- HTTP FAILED: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8c1d320: Failure in SSL library, usually a protocol error
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (external/openssl/ssl/s23_clnt.c:741 0x8d9bf990:0x00000000)
I have added connection spce with TLS version TLS_1_2. And now I am getting java.net.UnknownServiceException: Unable to find acceptable protocols
.
User contributions licensed under CC BY-SA 3.0