Forum Discussion

BurkApps's avatar
BurkApps
New member | Level 2
4 years ago

Could not connect to dropbox using dropbox api Android

I am using dropbox api in my android app and i was using Access Token to connect to my dropbox and it was working well for 2 years but now i can not make a connection with dropbox. Below is my code

 

DbxRequestConfig config = new DbxRequestConfig("dropbox/TestAppBurk");
client = new DbxClientV2(config, "AccessToken");
FullAccount account = null;
try {
account = client.users().getCurrentAccount();
} catch (DbxException e) {
e.printStackTrace();
}

 I am getting exception in the try catch. The exception is

"dropbox javax.net.ssl.SSLHandshakeException: Handshake failed"

2 Replies

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    4 years ago

    Hi BurkApps,

    Seems for some reason a secure connection can't be established. There are different possibility, but one option is that your code is running on environment not supporting TLSv1.2 - Dropbox servers accept currently only TLSv1.2. Check this at the beginning.

    One more thing is usage of long lived token in your application still. It cannot be a reason for your current issue, but can be for some future one! Existing long lived access tokens can still be used, but new such cannot be issued anymore. If you need a new one for some reason (lost or invalidation current token in use, for instance), your code will stop work. That why update your code on time.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    That's correct, Dropbox retired support for TLS 1.0 and 1.1 earlier this year, so that may be the cause of this error. The Dropbox API servers now only support connections using TLS 1.2. You'll need to update your app/network client/environment to use TLS 1.2 in order to continue making Dropbox API calls.

     
    It looks like you're using the Dropbox Java SDK, so to use TLS 1.2 you'll need to update to at least v3.1.1 of that SDK (or preferably, the latest version which is currently v5.3.0).

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!