Repository navigation
Add PGSSLMODE=no-verify support to opt-out of rejecting self-signed certs - #2195
Merged
Merged
Conversation
PGSSLMODE=noverify support to opt-out of rejecting self-signed certsPGSSLMODE=no-verify support to opt-out of rejecting self-signed certs
Owner
|
Thanks for adding this @benjames! I agree we need this. I'm going to need to write some tests for this before I merge it, but I'll do that & get it integrated within the next few days here! |
Contributor
Author
|
Thanks @brianc - much appreciated! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrading to
pg@8is currently quite hard if relying on environment variables to set the SSL mode. For example, on Heroku, SSL is required, but the certs are not available. A good way to set this up traditionally is to setPGSSLMODE=requirefor app dynos, andPGSSLMODE=false(or not defined) for in-dyno CI (local ephemeral test databases).However, in
pg@8the{ rejectUnauthorized: false }option needs to be used, so this means consumers need to update all code to be aware of the environment it's running in. This also extends to code from third parties (e.g. migration frameworks likedb-migrate), which would need to internally set this option to continue working. All of this means it's quite hard to upgrade.A simple solution is to to support implementing a
PGSSLMODE=no-verifyoption as suggested in this comment: #2009 (comment). This PR does exactly that! 👍