fix(plugin-cassandra): apply client certificate and key passphrase to SSL connections#1520
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e7938df12
ℹ️ 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".
| case clientKeyPassphraseRequired(serverMessage: String) | ||
| case clientKeyPassphraseIncorrect(serverMessage: String) | ||
| case clientKeyInvalid(serverMessage: String) |
There was a problem hiding this comment.
Bump the PluginKit version for new enum cases
Because these cases are inserted into SSLHandshakeError while PluginManager.currentPluginKitVersion still accepts kit version 16 plugins, an older plugin compiled with the previous enum layout can throw .cipherMismatch/.unknown and the host will decode that payload as one of the new passphrase/key errors. The app rejects only plugins whose declared TableProPluginKitVersion is different from the current version, so this ABI change needs a version bump (and matching plugin plist updates) before released plugins built against the old layout are loaded.
Useful? React with 👍 / 👎.
Fixes #1487.
Problem
The Cassandra SSL pane let you set a client certificate and key path, but the driver never applied them to the SSL context, and there was no field for an encrypted key's passphrase. An encrypted private key failed inside the handshake with a generic error that gave no hint about the passphrase.
Fix
Driver (the actual cause)
CassandraConnectionActornow applies the client cert and key to the SSL context withcass_ssl_set_certandcass_ssl_set_private_key(ssl, key, password)beforecass_cluster_set_ssl.clientKeyPassphraseRequired(encrypted key, no passphrase) orclientKeyPassphraseIncorrect(wrong passphrase). These twoSSLHandshakeErrorcases are appended at the end of the enum so existing discriminators don't shift for plugins built against the older PluginKit.UI
SecureField, but only when a client key path is set and the engine advertises the newsupportsClientKeyPassphrasecapability (true for Cassandra/ScyllaDB, false elsewhere), so it never appears as a dead control for engines that ignore it.Secret handling
com.TablePro.sslkeypassphrase.<id>), wired into delete and duplicate, and never written to the Codable/iCloud-syncedSSLConfiguration. It reaches the driver throughadditionalFields["sslClientKeyPassphrase"].Tests
SSLHandshakeErrorTests: the two new error cases.SSLConfigurationTests: the encoded JSON carries no passphrase or password.PluginKit / registry
currentPluginKitVersionbump: no protocol or signature change, and the new enum cases are appended for layout compatibility.plugin-cassandra-v*rebuild and release for the cert/key application and new error cases to reach registry users.