-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix parsing of ssl=false connection string parameter #2423
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
base: master
Are you sure you want to change the base?
Conversation
ssl was mistakenly set to the string "false" instead of the Boolean false.
( |
Alternatively, we could remove support for all |
I agree that since the other non-libpq modes are supported, ssl=false should be supported. When This is very surprising behavior, especially because the docs actually explicitly state this is allowed. If feature parity with libpq is more important, it could at least log a warning or throw an exception if the user uses this ssl flag in an unsupported way. |
It could possibly throw an uncaught exception without this patch. Reproduce Steps
const client = new Client({
connectionString: "postgres://postgres:postgres@localhost:5432/postgres?ssl=false",
});
client.connect();
// Throw uncaught exception
Since my application allows people to input any connection strings freely, throw an uncaught exception is not nice. Possible solutionsMethod 1: Merge this pull request. |
I observe that libpq throws an error when
I think this is the behavior we want to match. Muting causes "spooky action at a distance" problems. |
Cherry-picks iceddev/pg-connection-string#39 to this monorepo.