feat: TLS certificate file support

- NewConnectionDialog: TLS cert file selectors (CA/Cert/Key) + rejectUnauthorized checkbox
- connection.ts: read cert files and pass to ioredis tls options
- Add tlsRejectUnauthorized to all ConnectionConfig types
- i18n keys for tlsCaPath/tlsCertPath/tlsKeyPath/tlsRejectUnauthorized
This commit is contained in:
2026-07-05 16:35:38 +08:00
parent 6e6f170403
commit 1686af1a79
8 changed files with 102 additions and 8 deletions
+10
View File
@@ -13,6 +13,7 @@ export interface ConnectionConfig {
tlsCaPath: string
tlsCertPath: string
tlsKeyPath: string
tlsRejectUnauthorized: boolean
sshEnabled: boolean
sshHost: string
sshPort: number
@@ -83,6 +84,10 @@ export const useConnectionStore = defineStore('connection', () => {
password: auth || undefined,
username: conn.username || undefined,
tls: conn.tls,
tlsCaPath: conn.tlsCaPath,
tlsCertPath: conn.tlsCertPath,
tlsKeyPath: conn.tlsKeyPath,
tlsRejectUnauthorized: conn.tlsRejectUnauthorized,
sshEnabled: conn.sshEnabled,
sshHost: conn.sshHost,
sshPort: conn.sshPort,
@@ -151,6 +156,7 @@ export const useConnectionStore = defineStore('connection', () => {
async function testConnection(opts: {
host: string; port: number; auth?: string; username?: string; tls?: boolean
tlsCaPath?: string; tlsCertPath?: string; tlsKeyPath?: string
sshEnabled?: boolean; sshHost?: string; sshPort?: number; sshUsername?: string
sshPassword?: string; sshPrivateKeyPath?: string; sshPassphrase?: string
}): Promise<{ success: boolean; error?: string }> {
@@ -165,6 +171,10 @@ export const useConnectionStore = defineStore('connection', () => {
password: opts.auth || undefined,
username: opts.username || undefined,
tls: opts.tls,
tlsCaPath: opts.tlsCaPath,
tlsCertPath: opts.tlsCertPath,
tlsKeyPath: opts.tlsKeyPath,
tlsRejectUnauthorized: (opts as any).tlsRejectUnauthorized,
sshEnabled: opts.sshEnabled,
sshHost: opts.sshHost,
sshPort: opts.sshPort,