fix: correct SSL and SSH parsing in foreign app importers#889
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3836284d39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| switch properties["sslMode"] as? String ?? "" { | ||
| case "require": mode = SSLMode.required.rawValue | ||
| case "verify-ca": mode = SSLMode.verifyCa.rawValue | ||
| case "verify-full": mode = SSLMode.verifyIdentity.rawValue | ||
| default: mode = SSLMode.preferred.rawValue |
There was a problem hiding this comment.
Handle DBeaver
disable SSL mode explicitly
The new SSL-mode mapping treats every unrecognized sslMode as Preferred, so a DBeaver config that stores sslMode as disable (or any other non-listed value) is imported as TLS-enabled instead of TLS-disabled. That changes connection behavior during import and can cause connection failures or unexpected encryption settings; this switch should explicitly map known modes (including disable) and avoid defaulting unknown values to Preferred.
Useful? React with 👍 / 👎.
Summary
Fixes #887. PostgreSQL connections imported from TablePlus fail with
FATAL: no pg_hba.conf entry for host..., no encryptionbecause the SSL mode is lost during import.Full analysis revealed bugs across all three importers:
tLSMode=0(Prefer) was treated as "SSL disabled", and all non-zero modes were hardcoded to "Required". Now correctly maps all 4 TablePlus TLS modes (Prefer, Required, Verify CA, Verify Identity)handlers.sslwas not parsed at all. Now reads SSL mode and certificate paths following the same handler pattern as the existing SSH tunnel parsingStringbut Sequel Ace stores it asInt, causing custom SSH ports to silently default to 22. Now uses the Int-then-String patternTest plan