cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We've been busy working on some major updates to the Community, so check out what's changing, what’s staying the same and what you can expect from the Dropbox Community right here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Could not connect to dropbox using dropbox api Android

Could not connect to dropbox using dropbox api Android

BurkApps
New member | Level 2

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 2

Здравко
Legendary | Level 20

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
Dropbox Staff

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).
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?