postgresql - Connecting to Postgres Heroku DB through Intellij IDEA -


i've been trying connect postgres db day. can through pgadmin, can't connect through mysqlworkbench migrate , can't connect through intellij idea. we'll start w/intellij though...

so, when try connect through intellij, this...

connection sinthetics failed java.sql.sqlexception: ssl error: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target 

i take mean need certificate, since i'm using ssl (because it's postgres/heroku). so, run handy installcert so...

java installcert ec2-54-243-235-169.compute-1.amazonaws.com:5432 

and back:

loading keystore /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts... opening connection ec2-54-243-235-169.compute-1.amazonaws.com:5432... starting ssl handshake...  javax.net.ssl.sslhandshakeexception: remote host closed connection during handshake     @ sun.security.ssl.sslsocketimpl.readrecord(sslsocketimpl.java:953)     @ sun.security.ssl.sslsocketimpl.performinitialhandshake(sslsocketimpl.java:1332)     @ sun.security.ssl.sslsocketimpl.starthandshake(sslsocketimpl.java:1359)     @ sun.security.ssl.sslsocketimpl.starthandshake(sslsocketimpl.java:1343)     @ installcert.main(installcert.java:87) caused by: java.io.eofexception: ssl peer shut down incorrectly     @ sun.security.ssl.inputrecord.read(inputrecord.java:482)     @ sun.security.ssl.sslsocketimpl.readrecord(sslsocketimpl.java:934)     ... 4 more not obtain server certificate chain 

so why can't cert this, connects no problem pgadmin!? have clue @ all?

to add new connection postresql on heroku in intellij idea need to:

  1. database tool window / new / data source / postresql

  2. put host, port, database, user, password find on https://postgres.heroku.com/databases

  3. go advanced tab , put:

    • ssl: true
    • sslfactory: org.postgresql.ssl.nonvalidatingfactory
  4. profit.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -