Forum Discussion

outsidecoder's avatar
outsidecoder
Helpful | Level 5
7 years ago
Solved

Java SDK V2 SSL Example / How do you do it?

Thanks for opening.

I'm looking to use the Java SDK for Dropbox API V2 with SSL with some clients, and I've realised recently I've not been connecting with SSL.

How could I modify the code below to allow me to connect via SSL? 

 

    public void Connect() throws DbxException {
        System.out.println("his.details.getACCESS_TOKEN() = " + this.details.getACCESS_TOKEN());
        // Create Dropbox client
        config = new DbxRequestConfig(this.details.getClientIdentifier());
        client = new DbxClientV2(config, this.details.getACCESS_TOKEN());
        FullAccount account = client.users().getCurrentAccount();
        System.out.println(account.getName().getDisplayName());
    }

 

I've not been able to find any examples of this being done, but I've noticed SSLConfig but with no examples of it being used.  I thought SSL would be promoted to mitigate any security concerns.

Thanks :)

  • Greg-DB's avatar
    Greg-DB
    7 years ago

    All Dropbox API calls occur over standard HTTPS connections (specifically, currently using TLS v1.0, v1.1, or v1.2) initiated from the client sent to the Dropbox API servers, so that would just be destination port 443. That is the same regardless of geographic location and can't be changed.

    You can find the official list of domains used by Dropbox in the help center here:

    https://help.dropbox.com/security/official-domains

    For the API in particular, the specific ones are:

    • api.dropboxapi.com
    • content.dropboxapi.com
    • notify.dropboxapi.com
    • api.dropbox.com
    • api-content.dropbox.com
    • api-notify.dropbox.com

5 Replies

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

    The Dropbox API requires SSL/TLS for all API calls, and the Java SDK uses SSL/TLS by default. You don't need to configure anything to get it to do so.

    Can you elaborate on what you mean when you say you've "not been connecting with SSL"?

  • outsidecoder's avatar
    outsidecoder
    Helpful | Level 5
    7 years ago

    Thanks for the prompt reply.  I was watching the traffic on my ports and nothing seemed to use port 443 which I think is the SSL port.  Which port(s) does the Java SDK use?

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

    SSL/TLS connections do use port 443 on the destination server (the Dropbox API servers in this case). 

    When you say you were watching the traffic on your ports, do you mean you were looking at the source ports? Those wouldn't necessarilly be 443; 443 would be the destination port.

  • outsidecoder's avatar
    outsidecoder
    Helpful | Level 5
    7 years ago

    Apologies for the late reply.

    Essentially when I go into production with my product I need to detail the demands of using the Dropbox SDK on the firewall.

    For my purposes I will be using Asynchronous and Synchronous transfers within the SDK, but not utilsing the Sync features within the SDK.

    For the functionality utilised above, can Dropbox explicitely define the following:-

    1. Which ports need to be opened.
    2. which ports need to be bi-directional, and which need to be single direction, and in which direction they should be.
    3. What protocols will be used on those ports.  Would it just be HTTP traffic?
    4. What domains need to be accessible for UK customers.
    5. Can the ports detalied in question 1, be changed and if so how can this be acheived?

    Thanks for any assistance :)

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

    All Dropbox API calls occur over standard HTTPS connections (specifically, currently using TLS v1.0, v1.1, or v1.2) initiated from the client sent to the Dropbox API servers, so that would just be destination port 443. That is the same regardless of geographic location and can't be changed.

    You can find the official list of domains used by Dropbox in the help center here:

    https://help.dropbox.com/security/official-domains

    For the API in particular, the specific ones are:

    • api.dropboxapi.com
    • content.dropboxapi.com
    • notify.dropboxapi.com
    • api.dropbox.com
    • api-content.dropbox.com
    • api-notify.dropbox.com

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from 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!