Why You Can’t Terminate TLS at Traefik for PostgreSQL (and What to Do Instead)
Context I had the need to allow Power BI to connect to a PostgreSQL database running in Kubernetes, fronted by Traefik using a TCP entrypoint. At first, I hoped to terminate TLS at Traefik, the same way you’d do for HTTPS traffic. But this turned out not to be possible with standard PostgreSQL clients (psql, libpq, psycopg, etc.). Here’s why. Why This Happens Unlike HTTPS, PostgreSQL does not start a TLS handshake immediately. Instead, a libpq/psql client first sends a special SSLRequest packet: ...