Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataGrip Postgres SSL error: sun.security.validator.ValidatorException

DataGrip won't connect to my Postgres instance, but I can connect fine via psql on the terminal:

psql -h dbhost.com reps username
>Password for user... (connects)

However, IntelliJ DataGrip throws:

Connection to [email protected] failed.
SSL error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The connection string it uses is jdbc:postgresql://dbhost.com:5432/dbname

like image 649
Petrus Theron Avatar asked Feb 15 '17 10:02

Petrus Theron


2 Answers

Try disabling the SSL checkbox in the SSH/SSL tab in your database's property window.

Then append ?sslmode=require to the URL in the General tab so that it reads something like: jdbc:postgresql://localhost:5432/reps?sslmode=require

like image 57
Liam Clark Avatar answered Oct 09 '22 01:10

Liam Clark


Change sslmode to disable in Advanced tab in you database's property window

like image 3
Joey Gao Avatar answered Oct 09 '22 01:10

Joey Gao