fix(connection-form): default SSL mode to preferred for libpq and FreeTDS engines (#1298)#1309
Merged
Merged
Conversation
Merged
12 tasks
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.
Summary
Preferredinstead ofDisabled, matching libpq'ssslmode=preferand FreeTDS'sencryption=requestnative defaultspg_hba.confwith the "no pg_hba.conf entry for host ... no encryption" errorPluginMetadataSnapshot.CapabilityFlagsalongsidedefaultPortandsupportsSSL— declarative pattern, no PluginKit ABI bumpRoot cause
libpq, libmariadb, and FreeTDS all default to attempting TLS first and falling back to plain. TablePro overrode every engine with
sslmode=disable, breaking against any server withrds.force_ssl=1orhostsslrules inpg_hba.conf. DataGrip, psql, and pgAdmin "just work" because they don't override the driver default.Scope decision
.preferred: PostgreSQL, Redshift, CockroachDB (libpq), SQL Server (FreeTDS) — drivers that genuinely implementprefersemantics.disabled: MySQL, MariaDB (libmariadb bundled has onlyMYSQL_OPT_SSL_ENFORCEbinary toggle, noMYSQL_OPT_SSL_MODE), Mongo, Redis, Cassandra, ClickHouse, Oracle (binary-on/off drivers with no prefer semantics)MYSQL_OPT_SSL_MODE).disabledto preserve user intent)sslConfigJsonis absentWiring
DatabaseType.defaultSSLModecomputed property reads fromPluginMetadataRegistry, same pattern asdefaultPortSSLPaneViewModel.resetForType(_:)sets mode from registry and clears cert pathsConnectionFormCoordinator.applyTypeDefaultscalls it on engine change (coversstart(),didChangeType, andapplyParsedURL import)ConnectionFormCoordinator.applyParsedURL import:parsed.sslMode ?? parsed.type.defaultSSLModeConnectionFormCoordinator.applyClipboardCandidate: changedupgradeIfDisabled(.required)to unconditionalssl.mode = .requiredwhen clipboard URL hassslmode=require(otherwise the new.preferreddefault would silently swallow the user's explicit intent)SyncRecordMapper: fallback usesDatabaseType.defaultSSLModewhensslConfigJsonis missingTest plan
.disabled→ SSL pane still shows Disabled (intent preserved)pg_hba.conferrorpostgres://user:pass@host:5432/db?sslmode=requirefrom clipboard → form picks Required, not Preferredpostgres://user:pass@host:5432/db(no sslmode) from clipboard → form picks PreferredsslConfigJsonfield for PostgreSQL → decodes with.preferredxcodebuild test -only-testing:TableProTests/DatabaseTypeTests— all new defaultSSLMode tests passxcodebuild test -only-testing:TableProTests/SSLPaneViewModelTests— all resetForType tests pass