0

I am using StringRequest to call a web service. It is working fine on devices running Android 5.0 and above. This error occurs only on devices running 4.0 and above and below 5.0. Here is my stack trace

/Volley: [1] 7.onErrorResponse: Menus Error==>
03-23 02:56:09.201 1981-1981/com.example W/System.err: com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8d14900: Failure in SSL library, usually a protocol error
03-23 02:56:09.201 1981-1981/com.example W/System.err: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0xa5046d5c:0x00000000)
03-23 02:56:09.211 1981-1981/com.example W/System.err:     at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:177)
03-23 02:56:09.211 1981-1981/com.example W/System.err:     at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:120)
03-23 02:56:09.211 1981-1981/com.example W/System.err:     at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:87)
03-23 02:56:09.211 1981-1981/com.example W/System.err: Caused by: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8d14900: Failure in SSL library, usually a protocol error
03-23 02:56:09.211 1981-1981/com.example W/System.err: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0xa5046d5c:0x00000000)
03-23 02:56:09.231 1981-1981/com.example W/System.err:     at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
03-23 02:56:09.231 1981-1981/com.example W/System.err:     at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
03-23 02:56:09.241 1981-1981/com.example W/System.err:     at com.android.okhttp.Connection.connect(Connection.java:107)
03-23 02:56:09.241 1981-1981/com.example W/System.err:     at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
03-23 02:56:09.241 1981-1981/com.example W/System.err:     at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
03-23 02:56:09.241 1981-1981/com.example W/System.err:     at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
03-23 02:56:09.261 1981-1981/com.example W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
03-23 02:56:09.261 1981-1981/com.example W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
03-23 02:56:09.261 1981-1981/com.example W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
03-23 02:56:09.271 1981-1981/com.example W/System.err:     at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:136)
03-23 02:56:09.271 1981-1981/com.example W/System.err:     at com.android.volley.toolbox.HurlStack.executeRequest(HurlStack.java:99)
03-23 02:56:09.281 1981-1981/com.example W/System.err:     at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:131)
03-23 02:56:09.281 1981-1981/com.example W/System.err:  ... 2 more

PS: I have already tried the solution in this link

SSL Exception when using Volley

Ashwin H
  • 695
  • 7
  • 24
  • did you check whether you area calling http or https link ?! i had the same problem and it was because i was calling http Urls and by changing base address to https it work fine. – Omid Heshmatinia Mar 23 '18 at 07:16
  • @Omid Heshmatinia, am using https, this was working in http, but error occurred when i change it to https. – Ashwin H Mar 23 '18 at 07:38

1 Answers1

0

This seems to known exploits in Android.

https://developer.android.com/training/articles/security-gms-provider

try {
  ProviderInstaller.installIfNeeded(getContext());
} catch (GooglePlayServicesRepairableException e) {
   e.printStackTrace();
} catch (GooglePlayServicesNotAvailableException e) {
   e.printStackTrace();
}

Note : This solution works only if the devices has play service app

ramji
  • 1,982
  • 2
  • 13
  • 13