Skip to content

Commit c3ad5fd

Browse files
authored
Merge pull request #116 from malthe/issue-112-ssl-tls-documentation
Add additional SSL/TLS configuration documentation
2 parents ad68ed5 + 6e56508 commit c3ad5fd

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

README.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,25 @@ default value when applicable.
102102

103103
When applicable, "PG" environment variables used by _libpq_ apply, see
104104
the PostgreSQL documentation on [environment
105-
variables](https://www.postgresql.org/docs/current/libpq-envars.html). In
106-
particular, to disable the use of SSL, you can define the environment
107-
variable "PGSSLMODE" as "disable".
105+
variables](https://www.postgresql.org/docs/current/libpq-envars.html).
106+
107+
#### SSL/TLS configuration
108+
109+
As shown in the configuration options table in the previous section,
110+
the default behavior is to _prefer_ making a secure connection. That
111+
is, if the database has SSL/TLS configured, then the client will
112+
either make a secure connection or not connect at all.
113+
114+
For a self-signed certificate or a certificate that's not verifiable
115+
by the system certificates, either provide the signing certificate
116+
using the `NODE_EXTRA_CA_CERTS` environment variable, or disable
117+
SSL/TLS altogether using `SSLMode.Disable` or the environment variable
118+
`PGSSLMODE=disable`.
119+
120+
Note that _libpq_ supports a number of additional [SSL/TLS connection
121+
modes](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLMODE)
122+
but most of them do not sit well with Node's [tls
123+
module](https://nodejs.org/api/tls.html) and are not offered here.
108124

109125
### Querying
110126

0 commit comments

Comments
 (0)