-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
postgres sslmode #396
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
Comments
Hmm, I've not run into that using Postgres but I don't think I've explicitly tried it with that option. This might be a problem with TypeORM. Based on the comments in that thread, have you tried using If that doesn't work, to help replicate:
Any other info we can use to replicate (e.g. does it happen right away, or after it's been running a while, is this locally or in production or both) would be helpful. |
Hmm haven't tried using |
Setting ssl to true, doesn't seem to work. When I view my vercel logs I have the following errors:
|
I managed to fix this issue by including a certificate for my connection. I'll place my config below so if people stumble on the same issue, they can see this as a reference. (maybe it's also an idea to add it to the documentation? Could make a PR for it.)
|
Thank you this super interesting and I'm sure will be useful for other folks. I agree, it would be great to add this to the documentation, I'm not sure there is a great place for it. Feel free to leave this issue open till we find a home for it! |
Is that really including the cert? Or, are you turning off ssl with the line https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-node-js That article is EXTREMELY poorly written. The top of the article talks about how important it is to use SSL: "Most clients will connect over SSL by default, but on occasion it is necessary to set the sslmode=require parameter on a Postgres connection. Please add this parameter in code rather than editing the config var directly. Please check you are enforcing use of SSL especially if you are using Java or Node.js clients." But a plain English reading of |
No it is including the certificate, you still have to generate one yourself and afterwards read it from the filesystem. But you are correct about the reject part, that should be true.. not sure why I left the false part in it. I will edit it in my original comment. |
This may very well be a very insecure way of handling it, but for my test setup this works perfectly: adding |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks! |
Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks! |
As I had the issue where I was using Heroku's Postgre which somehow forces use to use SSL but has only a self-certification mechanism, this is what I came up with, using rejectaUnauthorized:false ... not very elegant but does the trick
|
This works for me. thanks |
I too was trying to work locally and kept getting the error Adding just The docs are still of no use. |
@skeddles thank you very much! Had a problem with postres db at vercel deployment. String: |
Uh oh!
There was an error while loading. Please reload this page.
Is it possible that the connection breaks when sslmode is set on "require" ?
I'm having trouble connecting to a postgres db where the sslmode is set to require
EDIT FROM MAINTAINER BELOW:
This has been resolved, but the documentation could be improved to avoid people asking this again, as per:
#396 (comment)
#396 (comment)
Feel free to open a PR documenting this!
The text was updated successfully, but these errors were encountered: