【发布时间】:2022-01-28 02:40:59
【问题描述】:
我整天都在尝试连接到我的 postgres 数据库。我可以通过 pgAdmin 来完成,但我无法通过 mySQLWorkbench 连接来迁移它,也无法通过 Intellij IDEA 连接。不过,我们将从 Intellij 开始...
所以,当我尝试通过 IntelliJ 连接时,我得到了这个...
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)。所以,我像这样运行我方便的 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 连接没有问题!?有人有线索吗?
【问题讨论】:
标签: postgresql ssl heroku intellij-idea