Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.sql.SQLException: FATAL: no pg_hba.conf entry for host

Developing RoR app on Windows using RubyMine, trying to connect to Postgres database hosted on Heroku server. No Postgres installed locally. Getting "java.sql.SQLException: FATAL: no pg_hba.conf entry for host..." What to do, what to do?

like image 466
Radu Grama Avatar asked Dec 02 '22 21:12

Radu Grama


1 Answers

This is due to Heroku databases needing additional SSL configuration. You need to enable SSL in your jdbc string by appending:

?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

For details see Heroku's help document.

like image 181
Ivar Avatar answered Dec 05 '22 12:12

Ivar