PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Created by Steve Place, Modified on Fri, 26 Jan 2024 at 12:36 PM by Steve Place

This error indicates your truststore can't find your certificate. Step 3 of our Encryption in Transit docs page shows the command to import the certificate:

 keytool -import -file myCert.crt -keystore my-truststore.jks

If you've imported the certificate and are still getting this error, your truststore still might not be able to find the certificate because you don't have your environment variables set up correctly. This command (from the same section of the same docs page) will set the environment variable:

export STARDOG_JAVA_ARGS="-Djavax.net.ssl.trustStore=/path/to/my-truststore.jks -Djavax.net.ssl.trustStorePassword=changeit"

Note that if you run a stardog or stardog-admin command with sudo, your terminal won't have access to your environment variables (and thus you'll get this error). We recommend running these commands without sudo. If for some reason you must use sudo, include the -E flag so the command receives your environment variables.


If you've taken all of the above troubleshooting steps and are still getting this error, detail the steps you've taken from Encryption in Transit in a support ticket and let us know where you got stuck.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article