Encrypted Postgres (SSL/TLS) connection does not work
🐛 Bug Report
Describe the bug
Encrypted Postgres (SSL/TLS) does not work, error: ERROR [Better Auth]: error [error: no pg_hba.conf entry for host "10.1.1.1", user "kanbn", database "kanbn", no encryption]
using env POSTGRES_URL: postgresql://kanbn:<secret>@pg.internal:5432/kanbn
or even require ssl with env POSTGRES_URL: postgresql://kanbn:<secret>@pg.internal:5432/kanbn?sslmode=require does not work.
To Reproduce Steps to reproduce the behavior:
- Deploy (or find provider with) postgres with tls
- Configure POSTGRES_URL as expected.
Expected behavior No error, just connect to database with encryption
- OS: Linux, Docker
- App version/commit: docker - latest (0.5.2)
Additional context I have a vps with docker and a private provider which offers postgres, but only via tls.
Maybe there is an easy option and i dont see it (in doc), or it is not supported?
Thanks for your help!
Fixed in #676. pg ignored useLibpqCompat, so sslmode=require forced strict cert verification instead of encrypt-only, breaking self-signed/private-CA setups. Available on edge now, pull latest once released.