Connection fails with 'PKIX path building failed: unable to find valid certification path to requested target' error

Problem

When connecting to a database in DataGrip, the following error appears:

PKIX path building failed: unable to find valid certification path to requested target

Cause

The issue is caused by the Java certificate not being passed to the JDBC driver when establishing a connection. As a result, the certificate is not registered in the Java trust store.

Resolution

  1. Open the SSL / SSH tab and make sure that the SSL checkbox is enabled. Then test the connection.
  2. Check whether all three trust store options are enabled in the SSL / SSH tab.
  3. If DataGrip is running on Windows, add the -Djavax.net.ssl.trustStoreType=WINDOWS-ROOT parameter to the data source VM options under the Advanced tab:

    Screenshot 2026-08-04 at 23.24.20.png
  4. If the suggestions above do not resolve the issue, it is important to manually register the certificates in your trust store and test the connection afterward. Doing so will indicate whether there is an issue at that stage. Guided instructions can be found in this thread.

If the connection still fails after completing all previous steps, enable SSL debug logging to capture detailed output that can help identify where the handshake breaks down by doing the following:

  1. Right-click the data source and open Diagnostics | Show JDBC Log Settings...
  2. In the opened JDBC Log Settings dialog:

    • Set SSL Logging to all
    • Select the Enabled checkbox
    Screenshot 2026-08-04 at 23.32.57.png
  3. Reproduce the issue.
  4. Share the resulting log output with JetBrains Support so that the issue can be investigated further.
0 out of 0 found this helpful

Please sign in to leave a comment.

Have more questions?

Submit a request