Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Al A.7's avatar
Al A.7
New member | Level 1
10 years ago

Getting Error unable to find valid certification path to requested target

I'm trying to use the dropox java sdk. Trying to run a simple test. But I get the following error when running this code

DbxEntry.WithChildren listing = clientV1.getMetadataWithChildren("/");

 

com.dropbox.core.DbxException$NetworkIO: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

 

This is strange, because httpurlconnection works fine going to https://www.dropbox.com  so the dropbox client cert is in my keystore. Is there another certificate that I need to import into my keystore that's missing?

Thanks

Al

 

 

5 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    What version of the SDK do you have, and how are you running this? The certificates are included in src/com/dropbox/core/http/trusted-certs.crt, but this should be handled for you. I.e., a trusted-certs.raw is generated during the Maven build, and you can see where it's loaded in SSLConfig.java.

  • Al A.7's avatar
    Al A.7
    New member | Level 1
    10 years ago

    I have dropbox-core-sdk-2.0-beta-3.jar file in my class path.I need to load the correct client certificates in my jvm cacerts file. 

  • Immediately before calling getMetadataWithChildren(), can you add the following line:

        System.getProperties().list(System.out);

    (You can also print to System.err if you prefer.)

    That information might help us debug the issue.

  • Al A.7's avatar
    Al A.7
    New member | Level 1
    10 years ago

    A little more info. I'm calling this sdk from tomcat webapp on java 1.7. If I call the api's directly (calling the https://api.dropbox.com/1/metadata/auto/?locale=en_US&list=true&file_limit=25000) using httpsURLConnection from the same webapp the ssl handshake completes. So your client certificate is in the jvm cacerts file. 

    But if I go through your SDK it fails with the error I gave you. I would rather use your sdk so I don't have to find all the URLs and then parse all the response json. 

    Here is the properties list

     

    -- listing properties --
    java.runtime.name=Java(TM) SE Runtime Environment
    java.protocol.handler.pkgs=javax.net.ssl
    sun.boot.library.path=C:\Udev\Hubble\jdk\jre\bin
    java.vm.version=24.51-b03
    shared.loader=
    java.vm.vendor=Oracle Corporation
    java.vendor.url=http://java.oracle.com/
    path.separator=;
    java.vm.name=Java HotSpot(TM) 64-Bit Server VM
    tomcat.util.buf.StringCache.byte.enabled=true
    file.encoding.pkg=sun.io
    user.script=
    user.country=US
    sun.java.launcher=SUN_STANDARD
    sun.os.patch.level=Service Pack 1
    tomcat.util.scan.StandardJarScanFilter.jarsToScan=log4j-core*.jar,log4j-taglib*.jar
    java.vm.specification.name=Java Virtual Machine Specification
    user.dir=C:\Udev\Hubble\tomcat\bin
    java.runtime.version=1.7.0_51-b13
    derby.system.home=C:\Udev\Hubble\Config
    java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
    java.endorsed.dirs=C:\Udev\Hubble\tomcat/common/endorsed
    os.arch=amd64
    java.io.tmpdir=C:\Udev\Hubble\tomcat\temp
    line.separator=

    java.vm.specification.vendor=Oracle Corporation
    user.variant=
    java.naming.factory.url.pkgs=org.apache.naming
    os.name=Windows 7
    sun.jnu.encoding=Cp1252
    java.library.path=C:\Udev\Hubble\jdk\bin;C:\Udev\Hubble...
    java.specification.name=Java Platform API Specification
    java.class.version=51.0
    sun.management.compiler=HotSpot 64-Bit Tiered Compilers
    os.version=6.1
    sun.io.useCanonCaches=false
    user.home=C:\Users\aaghili.MANAGEDMETHODS
    user.timezone=America/Denver
    catalina.useNaming=true
    java.awt.printerjob=sun.awt.windows.WPrinterJob
    java.specification.version=1.7
    file.encoding=Cp1252
    tomcat.util.scan.StandardJarScanFilter.jarsToSkip=bootstrap.jar,commons-daemon.jar,tomc...
    catalina.home=C:\Udev\Hubble\tomcat
    user.name=aaghili
    java.class.path=C:\Udev\Hubble\tomcat/bin/bootstrap.j...
    java.naming.factory.initial=org.apache.naming.java.javaURLContext...
    http.maxConnections=30
    package.definition=sun.,java.,org.apache.catalina.,org.a...
    java.vm.specification.version=1.7
    sun.arch.data.model=64
    java.home=C:\Udev\Hubble\jdk\jre
    sun.java.command=org.apache.catalina.startup.Bootstrap...
    java.specification.vendor=Oracle Corporation
    user.language=en
    awt.toolkit=sun.awt.windows.WToolkit
    java.vm.info=mixed mode
    java.version=1.7.0_51
    java.ext.dirs=C:\Udev\Hubble\jdk\jre\lib\ext;C:\Win...
    sun.boot.class.path=C:\Udev\Hubble\jdk\jre\lib\resources....
    java.vendor=Oracle Corporation
    server.loader=
    catalina.base=C:\Udev\Hubble\tomcat
    file.separator=\
    java.vendor.url.bug=http://bugreport.sun.com/bugreport/
    common.loader="${catalina.base}/lib","${catalina.ba...
    sun.cpu.endian=little
    sun.io.unicode.encoding=UnicodeLittle
    package.access=sun.,org.apache.catalina.,org.apache....
    sun.desktop=windows
    sun.cpu.isalist=amd64

     

     

     

     

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!