postgres connection fails on debian 12 (bookworm)
A connection to the database fails in a docker image based on debian bookworm:
django.db.utils.OperationalError: connection to server at "{db server}" ({ip}), port 5432 failed: could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied
connection to server at "{db server}" ({ip}), port 5432 failed: FATAL: no pg_hba.conf entry for host "{ip}", user "{user}", database "{name}", SSL off
For now, I reverted to debian bullseye in cc59adde.
If I understand the error message correctly, it first tries to connect with a client certificate that doesn't exist. Next it tries to connect without any SSL, which is rejected by the server.
I would expect it to connect with SSL, but without a client certificate. Not sure what is going wrong here.