Thursday, 31 May 2018

okhttp javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x5ffb7ea8: 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:744 0x5d727d74:0x00000000) javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x5ffb7ea8: Failure in SSL library, usuall


okhttp javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x5ffb7ea8: 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:744 0x5d727d74:0x00000000) javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x5ffb7ea8: Failure in SSL library, usuall

if you see above issue on your android app, and you are using android 4.4 to connect to a server which use TLS 1.2 then here is the right place to solve your issues:



Solution:

call below code when you app starts:

private void addAndroidSecurityProvider() {
    try {
        ProviderInstaller.installIfNeeded(this);
    } catch (GooglePlayServicesRepairableException e) {
        Log.d(TAG, e.getConnectionStatusCode() + "");
    } catch (GooglePlayServicesNotAvailableException e) {
        Log.e("SecurityException", "Google Play Services not available.");
    }
}

And put this into your gradle:

compile 'com.google.android.gms:play-services-auth:11.8.0'


https://stackoverflow.com/questions/29916962/javax-net-ssl-sslhandshakeexception-javax-net-ssl-sslprotocolexception-ssl-han




possible solution:

https://github.com/square/okhttp/issues/2372

No comments:

Post a comment