question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSLProtocolException

See original GitHub issue

General information

  • SDK/Library version: com.braintreepayments.api:drop-in:3.0.8
  • Environment: Sandbox
  • Android Version and Device: Samsung gt - s7390 with Android 4.1 API 16

Issue description

I tried to add the Drop-in UI in my android application but i get the following exception:

com.braintreepayments.api.exceptions.ConfigurationException: Request for configuration has failed: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x506cbae0: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x4bf22814:0x00000000). Future requests will retry up to 3 times

Here’s my code.

On button Click event:

public void showDropInUI(View view) {
        DropInRequest dropInRequest = new DropInRequest()
                .clientToken(clientToken) ;
        
        startActivityForResult(dropInRequest.getIntent(context), DROP_IN_REQUEST);
} 

public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == DROP_IN_REQUEST) {
            if (resultCode == Activity.RESULT_OK) {
                DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT);
                String paymentMethodNonce = result.getPaymentMethodNonce().getNonce();
                // send paymentMethodNonce to your server
            } else if (resultCode == Activity.RESULT_CANCELED) {
                // canceled
            } else {
                // an error occurred, checked the returned exception
                Exception exception = (Exception) data.getSerializableExtra(DropInActivity.EXTRA_ERROR);
            }
        }
}

I get the clientToken from my server method.

I try to use the Tokenization Key, insted of the clientToken, but i get the same error.

Am i missing something? Sorry for my english.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lkorthcommented, May 4, 2017

The SDK has had TLS 1.2 enabled on API 16-19 devices for quite some time.

We’ve heard of this issue occurring on a very small number of devices, but have never been able to get a device that reproduces this. We suspect an implementation bug on the devices that always tries to use SSLv3 and won’t fallback to other methods if the server does not support SSLv3.

As a quick test, if you put this code in your app and run it on the Samsung S7390 that is currently returning the error you should get some log output that may be useful in tracking this down.

try {
    SSLContext sslContext = SSLContext.getInstance("TLS");
    sslContext.init(null, null, null);
    SocketFactory socketFactory = sslContext.getSocketFactory();

    String[] supportedProtocols = ((SSLSocket) socketFactory.createSocket()).getSupportedProtocols();
    for (String protocol : supportedProtocols) {
        Log.d("SSL-TEST", "Supported SSL protocol: " + protocol);
    }
} catch (Exception e) {
    Log.d("SSL-TEST", e.getMessage());
}
1reaction
sdcoffeycommented, May 3, 2017

Hey @crocoM4,

Thanks for opening this issue. We’re aware of issues with the SSL implementation on that particular Samsung device that will prevent the device from communicating with Braintree’s servers. Note also that later this year, Braintree will be completely dropping support for all security protocols lower than TLS 1.2, as required by PCI regulations. See this article for more information on the industry’s transition to newer security protocols. Would you mind trying your integration on a newer device or emulator and letting us know if you’re still experiencing issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSLProtocolException (Java Platform SE 7 )
Reports an error in the operation of the SSL protocol. Normally this indicates a flaw in one of the protocol implementations.
Read more >
javax.net.ssl.SSLProtocolException: SSL handshake aborted ...
I found the solution for it by analyzing the data packets using wireshark. What I found is that while making a secure connection,...
Read more >
javax.net.ssl.SSLProtocolException: handshake alert - IBM
How to fix this SSL error javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name in Websphere Application Server?
Read more >
SSLProtocolException - Android Developers
public SSLProtocolException (String reason). Constructs an exception reporting an SSL protocol error detected by an SSL subsystem.
Read more >
SSLProtocolException (Java SE 20 & JDK 20 [build 1])
Reports an error in the operation of the SSL protocol. Normally this indicates a flaw in one of the protocol implementations. Since: 1.4;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found