Hi I am trying to connect to a local Postgres Db running in Virtualbox Centos, which connects through SSL tunnel. Example of how I connect via DBeaver is below.
- DBeaver I am using a SSL tunnel tab and
- I am using a pem file, and user and password
- The Virtualbox is set to forward port as follows
Postgres Virtualbox port forward
My Java code without ssl tunnel is this
DriverManager.getConnection("jdbc:postgresql://localhost:5432/dbName?user=postgresuser&password=givepassword");
This is failing saying pg_hba.conf
not found etc or if I give ssl=true
in connection string , says its not supported.. How do I connect to Local DB using ssl tunnel?
[ My assumption in that pg_hba.conf file would be available on the Virtualbox Host Vm only.]