Skip to content

fix(postgres): honor ssl_mode in build_connection_url#378

Open
darkrideroffate wants to merge 1 commit into
TabularisDB:mainfrom
darkrideroffate:fix/postgres-sslmode-in-connection-url
Open

fix(postgres): honor ssl_mode in build_connection_url#378
darkrideroffate wants to merge 1 commit into
TabularisDB:mainfrom
darkrideroffate:fix/postgres-sslmode-in-connection-url

Conversation

@darkrideroffate

Copy link
Copy Markdown

PostgreSQL's build_connection_url never set sslmode, so the sqlx path (test_connectionbuild_connection_urlAnyConnection::connect) defaulted to prefer and attempted TLS even when the user picked Disable. The pool path already honors ssl_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_mode onto the sslmode URL param, mirroring the MySQL driver, plus tests for the disable and default cases.

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.
@kilo-code-bot

kilo-code-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src-tauri/src/drivers/postgres/mod.rs
  • src-tauri/src/drivers/postgres/tests.rs

Reviewed by kimi-k2.6-20260420 · Input: 213.9K · Output: 12.2K · Cached: 880.8K

@debba debba requested a review from NewtTheWolf June 30, 2026 07:17
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.

1 participant