mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-06 06:13:51 +08:00
✨ feat(connection): 支持连接 SSL 证书文件配置
- 新增 CA 证书、客户端证书和私钥路径配置 - 为 MySQL、PostgreSQL、ClickHouse、MongoDB、Redis 等连接接入 TLS 证书 - 修正 SSL 模式下证书校验、明文回退和 DER 证书兼容问题 - 补充证书路径保存、RPC 传递和 DSN 生成回归测试 Refs #463
This commit is contained in:
@@ -148,6 +148,27 @@ describe('buildRpcConnectionConfig', () => {
|
||||
expect(result.connectionParams).toBe('characterEncoding=utf8&useSSL=false');
|
||||
});
|
||||
|
||||
it('preserves SSL certificate path fields for RPC calls', () => {
|
||||
const result = buildRpcConnectionConfig({
|
||||
id: 'conn-postgres-ssl',
|
||||
type: 'postgres',
|
||||
host: 'db.local',
|
||||
port: 5432,
|
||||
user: 'postgres',
|
||||
useSSL: true,
|
||||
sslMode: 'required',
|
||||
sslCAPath: 'C:/certs/ca.pem',
|
||||
sslCertPath: 'C:/certs/client-cert.pem',
|
||||
sslKeyPath: 'C:/certs/client-key.pem',
|
||||
} as any);
|
||||
|
||||
expect(result.useSSL).toBe(true);
|
||||
expect(result.sslMode).toBe('required');
|
||||
expect(result.sslCAPath).toBe('C:/certs/ca.pem');
|
||||
expect(result.sslCertPath).toBe('C:/certs/client-cert.pem');
|
||||
expect(result.sslKeyPath).toBe('C:/certs/client-key.pem');
|
||||
});
|
||||
|
||||
it('fills default nested config blocks needed by RPC calls', () => {
|
||||
const result = buildRpcConnectionConfig({
|
||||
id: 'conn-redis',
|
||||
|
||||
Reference in New Issue
Block a user