I use Volley on Android to fulfill my application requests. Unfortunately, I get the following error:
com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x61e15f78: Failure in SSL library, usually a protocol error error:1407743E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert inappropriate fallback (external/openssl/ssl/s23_clnt.c:744 0x5b647c58:0x00000000)
I use two Fragments , inside the ViewPager , which request their contents during onResume. The request URL is basically the same as the request parameter (which sets the type of content, for example, trend versus hot).
The URL is https://host/api/content?type={hot/trending} . Authorization is performed through the request header.
The strange part about this exception is that only one of the two queries fails and changes from time to time. After I added a delay between them, the exception stopped (strangely indicating some kind of race condition?). But this seems like a bad workaround, and I would like to solve it correctly.
Any thoughts on what might be causing this?
EDIT:
A request is created in a standard way using a singleton that provides a queue as follows:
final RequestQueue requestQueue = RequestQueueSingleton.getInstance(getActivity()).getRequestQueue(); final GsonRequestGet<SearchApiWrapper> gsonRequest = new GsonRequestGet<>(clazz, url,successListener, errorListener); gsonRequest.setRetryPolicy(new DefaultRetryPolicy(3000, 3, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); gsonRequest.setTag(mTag); requestQueue.add(gsonRequest);
And here is the singleton class:
public class RequestQueueSingleton { private static RequestQueueSingleton mInstance; private RequestQueue mRequestQueue; private Context mContext; public RequestQueueSingleton(Context context) { mContext = context; mRequestQueue = getRequestQueue(); } public static synchronized RequestQueueSingleton getInstance(Context context) { if (mInstance == null) { mInstance = new RequestQueueSingleton(context); } return mInstance; } public RequestQueue getRequestQueue() { if (mRequestQueue == null) { mRequestQueue = Volley.newRequestQueue(mContext.getApplicationContext()); } return mRequestQueue; } }
android android-volley
Eddson menegatti
source share