I've been trying to connect to my postgres DB all day. I can do it through pgAdmin, but I can't connect through mySQLWorkbench to migrate it and also can't connect through Intellij IDEA. We'll start w/Intellij though...
So, when I try to connect through IntelliJ, I get this...
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
I take this to mean that I need a certificate, since I'm using SSL (because it's a postgres/heroku). So, I run my handy InstallCert like so...
java InstallCert ec2-54-243-235-169.compute-1.amazonaws.com:5432
And get this back:
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
So why can't I get a cert for this, but it connects with no problem with pgAdmin!? Does anybody have a clue at all?
Create DB with Host, Port, Database, User, Password from data.heroku.com
Go to Advanced tab and put :
If you get error like this:
Connection to xxx.amazonaws.com failed. [08006] The hostname xxx.amazonaws.com could not be verified by hostnameverifier PgjdbcHostnameVerifier
Just put this value to advanced tab too:
To add new connection to your PostreSQL on Heroku in Intellij Idea you need to:
Database Tool Window / New / Data Source / PostreSQL
Put Host, Port, Database, User, Password that you find on https://postgres.heroku.com/databases
Go to Advanced tab and put:
Profit.
I get the same issue, downgrading to a minor version of Postgre Driver
worked for me.
PostgreDriverSettings:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With