kan icon indicating copy to clipboard operation
kan copied to clipboard

Encrypted Postgres (SSL/TLS) connection does not work

Open carl-unique opened this issue 7 months ago • 1 comments

🐛 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:

  1. Deploy (or find provider with) postgres with tls
  2. 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!

carl-unique avatar Apr 15 '26 16:04 carl-unique

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.

ovran avatar Nov 05 '26 23:11 ovran