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

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

DataGrip 无法连接到我的 Postgres 实例,但我可以通过终端上的 psql 正常连接:

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

但是,IntelliJ DataGrip 抛出:

Connection to username@dbhost.com 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

它使用的连接字符串是jdbc:postgresql://dbhost.com:5432/dbname

尝试禁用数据库 属性 window 中 SSH/SSL 选项卡中的 SSL 复选框。

然后将 ?sslmode=require 附加到“常规”选项卡中的 URL,这样它的内容如下: jdbc:postgresql://localhost:5432/reps?sslmode=require

在数据库 property window

Advanced 选项卡中将 sslmode 更改为 disable