Skip to content

Commit 71027bc

Browse files
committed
fix(plugins): reconcile SSLHandshakeError client-key cases across PluginKit copies
1 parent 5d616f5 commit 71027bc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Packages/TableProCore/Sources/TableProPluginKit/SSLHandshakeError.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ public enum SSLHandshakeError: Error, LocalizedError, Sendable {
88
case clientCertRequired(serverMessage: String)
99
case cipherMismatch(serverMessage: String)
1010
case unknown(serverMessage: String)
11+
case clientKeyPassphraseRequired(serverMessage: String)
12+
case clientKeyPassphraseIncorrect(serverMessage: String)
13+
case clientKeyInvalid(serverMessage: String)
1114

1215
public var serverMessage: String {
1316
switch self {
@@ -16,6 +19,9 @@ public enum SSLHandshakeError: Error, LocalizedError, Sendable {
1619
.untrustedCertificate(let msg),
1720
.hostnameMismatch(let msg),
1821
.clientCertRequired(let msg),
22+
.clientKeyPassphraseRequired(let msg),
23+
.clientKeyPassphraseIncorrect(let msg),
24+
.clientKeyInvalid(let msg),
1925
.cipherMismatch(let msg),
2026
.unknown(let msg):
2127
return msg
@@ -34,6 +40,12 @@ public enum SSLHandshakeError: Error, LocalizedError, Sendable {
3440
return String(localized: "The server's TLS certificate does not match the hostname being connected to.")
3541
case .clientCertRequired:
3642
return String(localized: "The server requires a client certificate for TLS mutual authentication.")
43+
case .clientKeyPassphraseRequired:
44+
return String(localized: "The client private key is encrypted and needs a passphrase.")
45+
case .clientKeyPassphraseIncorrect:
46+
return String(localized: "The passphrase for the client private key is incorrect.")
47+
case .clientKeyInvalid:
48+
return String(localized: "The client private key could not be read. It may be malformed or in an unsupported format.")
3749
case .cipherMismatch:
3850
return String(localized: "The server and TablePro could not agree on a TLS cipher or protocol version.")
3951
case .unknown:
@@ -86,6 +98,12 @@ public enum SSLHandshakeError: Error, LocalizedError, Sendable {
8698
return String(localized: "Switch SSL Mode to Verify CA (validates the CA chain but skips hostname check), or update the host field to match the certificate.")
8799
case .clientCertRequired:
88100
return String(localized: "Provide the client certificate and key paths in the SSL tab.")
101+
case .clientKeyPassphraseRequired:
102+
return String(localized: "Open the connection editor, switch to the SSL tab, and enter the Key Passphrase.")
103+
case .clientKeyPassphraseIncorrect:
104+
return String(localized: "Open the connection editor, switch to the SSL tab, and correct the Key Passphrase.")
105+
case .clientKeyInvalid:
106+
return String(localized: "Check that the Client Key path points to a valid PEM private key.")
89107
case .cipherMismatch:
90108
return String(localized: "Update the server's TLS configuration or use a newer database server version that supports modern ciphers.")
91109
case .unknown:

0 commit comments

Comments
 (0)