Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional SSL/TLS configuration documentation #116

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,25 @@ default value when applicable.

When applicable, "PG" environment variables used by _libpq_ apply, see
the PostgreSQL documentation on [environment
variables](https://www.postgresql.org/docs/current/libpq-envars.html). In
particular, to disable the use of SSL, you can define the environment
variable "PGSSLMODE" as "disable".
variables](https://www.postgresql.org/docs/current/libpq-envars.html).

#### SSL/TLS configuration

As shown in the configuration options table in the previous section,
the default behavior is to _prefer_ making a secure connection. That
is, if the database has SSL/TLS configured, then the client will
either make a secure connection or not connect at all.

For a self-signed certificate or a certificate that's not verifiable
by the system certificates, either provide the signing certificate
using the `NODE_EXTRA_CA_CERTS` environment variable, or disable
SSL/TLS altogether using `SSLMode.Disable` or the environment variable
`PGSSLMODE=disable`.

Note that _libpq_ supports a number of additional [SSL/TLS connection
modes](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLMODE)
but most of them do not sit well with Node's [tls
module](https://nodejs.org/api/tls.html) and are not offered here.

### Querying

Expand Down
Loading