PostgreSQL SSL Connection on EC2

Solved!
felix
Level 1
PostgreSQL SSL Connection on EC2

I deployed Dataiku on an EC2 instance, it looks great!



Unfortunately, I can't connect to my Heroku PostgreSQL database because it forces the use of SSL.



How can I enable SSL for the PostgreSQL JDBC driver?



I have very little knowledge about servers beside ssh-ing into a machine.



I found this doc but I'm not even sure it's related at all: postgresql.org/docs/current/static/ssl-tcp.html

(here we just want the driver to connect through SSL not setup SSL for postgres I guess)



[Copy/Pasting the error message here to be referenced in Google when someone has the same issue: FATAL: no pg_hba.conf entry for host "....", user "...", database "...", SSL off]

0 Kudos
1 Solution
Clรฉment_Stenac

Hi,



You need to add the "ssl" property (in the connection page) and set it to "true"



Note that you also need either to properly setup client certificates (as instructed here: https://jdbc.postgresql.org/documentation/91/ssl-client.html), or, if you want to disable validation (although this negates part of the security), add another property:



sslfactory = org.postgresql.ssl.NonValidatingFactory



 

View solution in original post

0 Kudos
2 Replies
Clรฉment_Stenac

Hi,



You need to add the "ssl" property (in the connection page) and set it to "true"



Note that you also need either to properly setup client certificates (as instructed here: https://jdbc.postgresql.org/documentation/91/ssl-client.html), or, if you want to disable validation (although this negates part of the security), add another property:



sslfactory = org.postgresql.ssl.NonValidatingFactory



 

0 Kudos
felix
Level 1
Author
Many thanks for the quick reply Clรฉment! That worked!
(I tried the easy solution, disabling validation)
0 Kudos

Labels

?
Labels (3)
A banner prompting to get Dataiku