Add SSL support for postgres containers by cristianrgreco · Pull Request #1224 · testcontainers/testcontainers-node
Navigation Menu
- Notifications You must be signed in to change notification settings
- Fork 257
Conversation
Summary
- add opt-in SSL helpers to
PostgreSqlContainer:withSSL(certFile, keyFile, caCertFile?)andwithSSLCert(caCertFile, certFile, keyFile) - copy SSL material into the container and use a small entrypoint wrapper to fix postgres file ownership before startup
- enable postgres SSL via
-cflags only when SSL is configured - add SSL integration coverage for postgres + postgis + pgvector + timescale variants
- add test cert fixtures plus a
test-certs/generate-certs.shscript and docs note/example
Verification
npm test -- packages/modules/postgresql/src/postgresql-container.test.ts packages/modules/postgresql/src/postgresql-container-snapshot.test.ts packages/modules/postgresql/src/postgis-container.test.ts packages/modules/postgresql/src/pgvector-container.test.ts packages/modules/postgresql/src/timescale-container.test.ts- Coverage includes:
- PostgreSQL base container
- Snapshot/restore behavior
- PostGIS variant
- PGVector variant
- Timescale variant
Result
- Test files: 5 passed
- Tests: 21 passed
Closes #1113
cristianrgreco
changed the title
feat(postgresql): add opt-in SSL support for postgres containers
Add opt-in SSL support for postgres containers
cristianrgreco
changed the title
Add opt-in SSL support for postgres containers
Add SSL support for postgres containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters