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

Warn about mixed use of connectionString and ssl #130

Merged
merged 1 commit into from
Oct 10, 2021

Conversation

chornsby
Copy link
Contributor

@chornsby chornsby commented May 6, 2021

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:
brianc/node-postgres#2375
brianc/node-postgres#2380

@netlify
Copy link

netlify bot commented May 6, 2021

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

Built with commit 2f48c90

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

@brianc
Copy link
Owner

brianc commented Oct 10, 2021

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

@brianc brianc merged commit 2e179fc into brianc:master Oct 10, 2021
@ksrtilak
Copy link

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
Copy link

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

@charmander
Copy link
Collaborator

@ksrtilak Yes.

@ksrtilak
Copy link

ksrtilak commented Oct 21, 2023

Thanks for your confirmation.

Please help with these as well:

  • For sslmode = required. only key and cert are mandatory, Is this correct ?
  • Which sslmode needs both password and key/cert pair ?

@ksrtilak Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants