brianc / node-postgres-docs

Documentation for node-postgres
https://node-postgres.com
MIT License
98 stars 94 forks source link

Warn about mixed use of connectionString and ssl #130

Closed chornsby closed 2 years ago

chornsby commented 3 years ago

I tripped over this case today when handling client code which used both connectionString and ssl configuration options and the former unexpectedly overrides the latter.

The relevant code that handles this is here: https://github.com/brianc/node-postgres/blob/4b229275cfe41ca17b7d69bd39f91ada0068a5d0/packages/pg-connection-string/index.js#L68-L70

Other people with similar confusion: https://github.com/brianc/node-postgres/issues/2375 https://github.com/brianc/node-postgres/issues/2380

netlify[bot] commented 3 years ago

Hey! A preview of the changes is deployed on netlify to take a look at! :)

Built with commit 2f48c90ddb48a58f8a780fae1b58d8f0c4c5766f

https://deploy-preview-130--hopeful-clarke-f36d36.netlify.app

brianc commented 2 years ago

Thanks! Sorry you ran into that issue, hopefully I can fix that soon. 😄

ksrtilak commented 11 months ago

Hi, When I specify sslmode in the ssl configuration options, it is not honoured. When I specify sslmode in connection string instead, it fails with "Error: self signed certificate in certificate chain"

Please suggest a way to be able to provide sslmode

ksrtilak commented 11 months ago

If I use rejectUnauthorized as true, along with ca, key and cert Is this equivalent to sslmode as verify-full ?

charmander commented 11 months ago

@ksrtilak Yes.

ksrtilak commented 11 months ago

Thanks for your confirmation.

Please help with these as well:

@ksrtilak Yes.