How to use Testcontainers with PostgreSQL and SSL
Using Testcontainers with PostgreSQL over SSL/TLS (with client certificates) This guide walks you through running PostgreSQL in Testcontainers with SSL enabled and client-certificate authentication (verify-full). It explains: How to generate a CA, server, and client certificates. How to prepare certificate/key files and the right formats/permissions. How to configure PostgreSQL (postgresql.conf and pg_hba.conf) to require client certificates. How to wire everything up in Testcontainers. How to connect from Java (JDBC) and optionally from the psql CLI. Everything here is based on the code in this repository, particularly: ...