How to connect to database from outside

Hello, I would like to connect with, for example DBeaver to the running PostgreSQL database in a job with network mode bridge.

What would be needed in order to be able to connect directly to this DB? I have ssh access to the client and I tried to create a ssh tunnel like ssh -L 63333:192.168.1.186:28085 user@host but I’m getting errors about SSL, ConnectionFactoryImpl/enableSSL An error occurred while setting up the SSL connection.

I don’t know if I need to add SSL configuration to be able to connect, or that error is something else and it’s actually not reaching Postgres.

In that case, how could I get the certificates? Through nomad cli?

Thanks!

If you use internal network, you had 2 options:

  1. create a self signed cert and install in postgresql install using volumes, and connect with private key ssl from your desk.
  2. configure postgres to not require ssl on 192.168.1.0/24 network

It seens more ssl problem than nomad problem perhaps

1 Like