Reputation: 2165
I am writing a struts2 app and using hibernate for persistence. I deploy may app on heroku and everything works ok, but when ever I run it locally I get:
org.postgresql.util.PSQLException: FATAL:no pg_hba.conf entry for host "xx.xx.xxx.xxx", user "someuser", database "somedatabase", SSL off
I know the problem is I need to connect to the database over ssl but how can I set this up locally?
Upvotes: 2
Views: 823
Reputation: 6067
Add this to the end of your JDBC connection URL:
?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
Upvotes: 5
Reputation: 325051
The key here is "SSL off".
You must use SSL to connect to Heroku. How to enable it depends on the client you are using, which I'm guessing is PgJDBC since you're using Java and Hibernate.
The SSL section of the manual for PgJDBC covers what you need.
Upvotes: 2