question

dnalor avatar image
dnalor asked chanel Deactivated commented

Getting SSLHandshakeException on production Clover Mini

@Sam Here's my problem in detail.

The problem occurs on our production Clover Mini devices only, the same code snippet works perfectly fine on sandbox Mini & Station plus on production Station.

We did reproduce the error on our merchant's device with the ID of MMPGPHJ3C2EXJ and sent a device log from the help app at the following timestamp: 1493981820

The error message we are getting:

javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x6aef3008: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23GETSERVERHELLO:sslv3 alert handshake failure (external/openssl/ssl/s23clnt.c:744 0x68532ce0:0x00000000)

The corresponding code is about paying for a freshly created order.

Snippets:

Get order created in the previous step:

mCreatedOrder = mOrderConnector.getOrder(mOrderID);

Declare json body to be sent:

JSONObject paymentParamsBody = new JSONObject();
paymentParamsBody.put("tender", new JSONObject());
paymentParamsBody.getJSONObject("tender").put("id", mPaymentTender.getId());
paymentParamsBody.put("amount", mCreatedOrder.getTotal());

Fire the http post to pay for the order

final MediaType JSON = MediaType.parse("application/json; charset=utf-8");

OkHttpClient client = new OkHttpClient();

String url = mBaseURL + "/v3/merchants/" + mMerchant.getId() + "/orders/" + mCreatedOrder.getId() + "/payments?access_token=" + MyApplication.getAuthToken();
String json = paymentParamsBody.toString();

RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder().url(url).post(body).build();
Response response = client.newCall(request).execute();
Production
3 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

paulbrendanconroy avatar image paulbrendanconroy commented ·

If only I had enough Karma to upvote this.

0 Likes 0 ·
sam avatar image sam commented ·

Looking at the error log specifically, it looks like it's using the SSLv3 protocol rather than the default TLS. http://stackoverflow.com/questions/29...

0 Likes 0 ·
amar avatar image amar sam commented ·

I have tried with custom ssl factory class.

Not working in my case clover Mini, error still exist.(Using retrofit:2.1.0,OkHttp:2.4.0, Clover Api:https://api.eu.clover.com/v3/merchants/)

javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted. Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23).

How to use ProviderInstaller as Clover don't have googlePlayStore feature?

Any suggestion?

0 Likes 0 ·

1 Answer

dnalor avatar image
dnalor answered chanel Deactivated commented
We could fix this issue at last.

There seems to be a problem with OkHttp on Android 4.1-4.4 regarding the use of TLSv1.2, therefore we had to use the following workaround:
https://github.com/square/okhttp/issues/2372
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amar avatar image amar commented ·

Not working in my case clover Mini, error still exist.(Using retrofit:2.1.0,OkHttp:2.4.0, Clover Api:https://api.eu.clover.com/v3/merchants/)

javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted. Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23).

Any suggestion?

0 Likes 0 ·
chanel avatar image chanel amar commented ·

Hi @Amar, please create a new question with a code sample and full stacktrace error.

0 Likes 0 ·

Welcome to the
Clover Developer Community