Hello,
When using a database that requires SSL—such as an AWS RDS database—we need to provide an SSL certificate.
Currently, this does not seem possible because the connection does not use the provided dbUrl as-is. Instead, it extracts parts of the URL to initialize the connection (ref:
|
this.pool = new pg.Pool({ |
).
I found few issues reporting this problem, but none of them provide a good solution. Here is an example: #493
The closest workaround I found is this comment, which suggests using the environment variables PGSSLMODE and PGSSLROOTCERT. However, it turns out that node-postgres does not support PGSSLROOTCERT (see brianc/node-postgres#2723).
I also saw an attempt to address this by allowing extra options when instantiating PostgreSQLSessionStorage in #727, but the PR was not merged. Why hasn't this solution or a similar one been implemented yet?
In the meantime, is there a solution to provide an SSL certificate, or is self-patching the only way to use this library with databases that require SSL connections?