fix(postgres): honor ssl_mode in build_connection_url#378
Open
darkrideroffate wants to merge 1 commit into
Open
fix(postgres): honor ssl_mode in build_connection_url#378darkrideroffate wants to merge 1 commit into
darkrideroffate wants to merge 1 commit into
Conversation
The sqlx-based connection path (DatabaseDriver::test_connection -> build_connection_url -> AnyConnection::connect) omitted the sslmode parameter, so sqlx defaulted to prefer and attempted TLS even when the user selected Disable. This diverged from the pool path (build_postgres_configurations), which honors ssl_mode, causing Load Databases to succeed while opening the connection failed against servers that reject the negotiated TLS (e.g. CloudNativePG forcing TLS 1.3): 'bad protocol version'. Map ssl_mode onto the libpq sslmode URL parameter, mirroring the MySQL driver, and add tests covering the disable case and the unset default.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by kimi-k2.6-20260420 · Input: 213.9K · Output: 12.2K · Cached: 880.8K |
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.
PostgreSQL's
build_connection_urlnever setsslmode, so the sqlx path (test_connection→build_connection_url→AnyConnection::connect) defaulted topreferand attempted TLS even when the user picked Disable. The pool path already honorsssl_mode, so Load Databases worked while opening the connection failed against servers that reject the negotiated TLS (e.g. CloudNativePG forcing TLS 1.3):bad protocol version.Now maps
ssl_modeonto thesslmodeURL param, mirroring the MySQL driver, plus tests for thedisableand default cases.