Postgresql 通过Intellij IDEA连接到Postgres Heroku DB
我一整天都在尝试连接我的postgres DB。我可以通过pgAdmin来完成,但是我不能通过mySQLWorkbench连接来迁移它,也不能通过Intellij IDEA连接。我们将开始与Intellij合作,但是 所以,当我尝试通过IntelliJ连接时,我得到了这个Postgresql 通过Intellij IDEA连接到Postgres Heroku DB,postgresql,ssl,heroku,intellij-idea,Postgresql,Ssl,Heroku,Intellij Idea,我一整天都在尝试连接我的postgres DB。我可以通过pgAdmin来完成,但是我不能通过mySQLWorkbench连接来迁移它,也不能通过Intellij IDEA连接。我们将开始与Intellij合作,但是 所以,当我尝试通过IntelliJ连接时,我得到了这个 Connection to Sinthetics failed java.sql.SQLException: SSL error: sun.security.validator.ValidatorException: PKIX
Connection to Sinthetics failed
java.sql.SQLException: SSL error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
我认为这意味着我需要一个证书,因为我使用的是SSL(因为它是postgres/heroku)。所以,我像这样运行我的handy InstallCert
java InstallCert ec2-54-243-235-169.compute-1.amazonaws.com:5432
把这个拿回来:
Loading KeyStore /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts...
Opening connection to ec2-54-243-235-169.compute-1.amazonaws.com:5432...
Starting SSL handshake...
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:953)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
at InstallCert.main(InstallCert.java:87)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:482)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)
... 4 more
Could not obtain server certificate chain
那么为什么我不能得到一个证书,但它连接与pgAdmin没有问题!?有人有任何线索吗?要在Intellij Idea中的Heroku上为PostreSQL添加新连接,您需要:
- ssl:true
- sslmode:验证ca
- sslfactory:org.postgresql.ssl.nonvalidating工厂
我也遇到了同样的问题,降级到一个次要版本的
Postgre-Driver
为我工作
PostgreDriverSettings:
从data.heroku.com使用主机、端口、数据库、用户和密码创建数据库 转到“高级”选项卡并放入:
- ssl:true
- sslfactory:org.postgresql.ssl.NonValidatingFactory
- sslmode:验证ca