A utility for parsing libpq-style environment variables into SSL configuration for node-postgres (pg). As of v0.0.1, it bridges a gap where node-postgres ignores SSL-related environment variables like PGSSLMODE, PGSSLROOTCERT, PGSSLCERT, and PGSSLKEY. It reads these env vars to produce the `ssl` object expected by `new Pool()`, including ca, cert, key, and rejectUnauthorized. Supports custom overrides, servername for SNI, and checkServerIdentity callback. Particularly useful for cloud SQL connections (e.g., Google Cloud SQL, AWS RDS) that require certificate-based TLS. Lightweight, no dependencies, and works with both ESM and CJS.
npm install pg-sslNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to use parseSsl to configure SSL for a pg Pool, including optional servername override for cloud SQL.
Manually set rejectUnauthorized and provide cert paths if using sslmode other than 'disabled'.
Run `npm install pg-ssl` and ensure your import uses the correct package name.
Use `import { parseSsl } from 'pg-ssl'` instead of `import parseSsl from 'pg-ssl'`.Set PGSSLROOTCERT to the CA certificate path and pass the path to parseSsl or set the env variable.
No dependency data recorded yet.