fix(postgres): read SSL config from nested DBeaver JSON properties#21
Open
hongweihao wants to merge 1 commit intosrthkdev:mainfrom
Open
fix(postgres): read SSL config from nested DBeaver JSON properties#21hongweihao wants to merge 1 commit intosrthkdev:mainfrom
hongweihao wants to merge 1 commit intosrthkdev:mainfrom
Conversation
DBeaver's JSON config format (v21+) stores driver-level properties under a nested `properties` key and SSL handler config under `handlers.postgre_ssl`, rather than at the top level of the connection properties object. Previously, `getPostgresSslConfig` and `executePostgreSQLQuery` only read from the top-level `properties.sslmode` / `properties.ssl` fields, which are always undefined in the new format. This caused the SSL mode to fall back to the default or be treated as disabled, resulting in unencrypted connections that are rejected by servers requiring SSL (e.g. AWS RDS with `hostssl` pg_hba.conf rules). Fix by also checking: - `properties.properties.sslmode` / `properties.properties.ssl` (nested driver props) - `properties.handlers.postgre_ssl.enabled` + `properties.handlers.postgre_ssl.properties.sslMode` (DBeaver's SSL handler block) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
When using DBeaver's modern JSON config format (v21+), PostgreSQL connections configured with SSL fail with:
even though SSL is correctly configured in DBeaver.
Root Cause
DBeaver's JSON config format stores driver-level properties under a nested
propertieskey and the SSL handler config underhandlers.postgre_ssl, rather than at the top level of the connection properties object:{ "configuration": { "url": "jdbc:postgresql://host:5432/mydb", "properties": { "sslmode": "require", "ssl": "true" }, "handlers": { "postgre_ssl": { "enabled": true, "properties": { "sslMode": "require" } } } } }Both
getPostgresSslConfig(inconnection-pool.ts) andexecutePostgreSQLQuery(indbeaver-client.ts) only read from the top-levelproperties.sslmode/properties.ssl, which are alwaysundefinedin this format. As a result, SSL mode falls back to the default or is treated as disabled, and the connection is sent without encryption — causing servers that require SSL (e.g. AWS RDS withhostsslinpg_hba.conf) to reject it.Fix
Both SSL-reading locations now also check:
properties.properties.sslmode/properties.properties.ssl— nested driver propsproperties.handlers.postgre_ssl.enabled+properties.handlers.postgre_ssl.properties.sslMode— DBeaver's SSL handler blockTesting
Verified against an AWS RDS PostgreSQL 15 instance configured with
hostsslinpg_hba.conf. Before this fix,test_connectionreturned "no encryption" error. After the fix, the connection succeeds with SSL.🤖 Generated with Claude Code