Open
Description
The default sslmode
in libpq is prefer
:
first try an SSL connection; if that fails, try a non-SSL connection
It should be possible to have similar fallback behavior in node-postgres.
Currently, the following will fail with a The server does not support SSL connections
error if the DB does not support TLS:
const client = new Client({ ssl: { rejectUnauthorized: true } });
await client.connect();
This requires knowing ahead of time whether the server supports TLS or not, even if we don't care about TLS.