Skip to content

Add SSL support for postgres containers#1224

Merged
cristianrgreco merged 2 commits intomainfrom
codex/issue-1113-postgres-ssl
Feb 17, 2026
Merged

Add SSL support for postgres containers#1224
cristianrgreco merged 2 commits intomainfrom
codex/issue-1113-postgres-ssl

Conversation

@cristianrgreco
Copy link
Collaborator

@cristianrgreco cristianrgreco commented Feb 17, 2026

Summary

  • add opt-in SSL helpers to PostgreSqlContainer: withSSL(certFile, keyFile, caCertFile?) and withSSLCert(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 -c flags 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.sh script 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

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit 7a74927
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-node/deploys/69943a769ab6e40008cc6ea2
😎 Deploy Preview https://deploy-preview-1224--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cristianrgreco cristianrgreco added enhancement New feature or request minor Backward compatible functionality labels Feb 17, 2026
@cristianrgreco cristianrgreco changed the title feat(postgresql): add opt-in SSL support for postgres containers Add opt-in SSL support for postgres containers Feb 17, 2026
@cristianrgreco cristianrgreco changed the title Add opt-in SSL support for postgres containers Add SSL support for postgres containers Feb 17, 2026
@cristianrgreco cristianrgreco merged commit 0481c58 into main Feb 17, 2026
20 checks passed
@cristianrgreco cristianrgreco deleted the codex/issue-1113-postgres-ssl branch February 17, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor Backward compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Enable SSL support for postgres

1 participant