codewinsdotcom/PostgresClientKit

Postgresql DB configured with ssh

chanykf opened this issue · 4 comments

If the database is configured with ssh, how can I cope with it when handling the connection with PostgresClientKit? Your advice is appreciated. Thank you!

Does this help?

https://www.postgresql.org/docs/current/ssh-tunnels.html

I haven't tried using PostgresClientKit with an SSH tunnel, but I don't see any reason it wouldn't work.

Any reason you can't use SSL/TLS instead?

Thank you for your prompt reply. The situation is that the project is at "proof of concept" stage, and we would like to explore some cost-effective alternatives, such as SSH. Yes, you are right, we definitely need SSL/TLS at the next stage. Once again, thank you for your advice!

Just FYI, PostgreSQL supports the server using self-signed SSL/TLS certificates, which are free and easy to generate.

https://www.postgresql.org/docs/current/ssl-tcp.html#SSL-CERTIFICATE-CREATION

Great! Will explore this option as well. Thanks!