feat: 添加服务端证书合法性验证(自定义CA/跳过验证/证书固定)
Release / build-macos (push) Canceled after 0s
Release / build-windows (push) Canceled after 0s
Release / release (push) Canceled after 0s

- 新增 internal/tlsconfig 包,集中构建 TLS 配置
- 修复 CDN 边缘 IP 故障转移时 HTTP 登录 TLS 验证失败的问题
- 支持自定义 CA 证书(内联 PEM + 文件路径,合并生效)
- 支持 InsecureSkipVerify 跳过证书验证
- 支持证书固定(SHA-256 指纹校验)
- TLS 验证错误设为不可恢复,避免无限重试
- Profile 编辑界面新增 TLS 设置区域,协议联动启用/禁用
- DB schema v4 迁移,新增 4 个 TLS 字段
This commit is contained in:
2026-07-08 11:33:36 +08:00
parent 97cd9d4553
commit bf4744bb1d
14 changed files with 434 additions and 60 deletions
+21 -12
View File
@@ -158,15 +158,19 @@ func (a *App) onConnect() {
// Build and send the start command.
cfg := ipc.ClientConfig{
ServerURL: serverURL,
SNIHost: sniHost,
ServerIPs: serverIPs,
Username: p.Username,
Password: password,
AuthMode: string(p.AuthMode),
RoutingMode: string(p.RoutingMode),
CustomCIDRs: splitCIDRs(p.CustomCIDRs),
MTUOverride: p.MTUOverride,
ServerURL: serverURL,
SNIHost: sniHost,
ServerIPs: serverIPs,
Username: p.Username,
Password: password,
AuthMode: string(p.AuthMode),
RoutingMode: string(p.RoutingMode),
CustomCIDRs: splitCIDRs(p.CustomCIDRs),
MTUOverride: p.MTUOverride,
TLSCACert: p.TLSCACert,
TLSCAPath: p.TLSCAPath,
TLSInsecure: p.TLSInsecure,
TLSPinnedHash: p.TLSPinnedHash,
}
if err := ipc.SendStart(client, cfg); err != nil {
fyne.Do(func() {
@@ -241,9 +245,14 @@ func (a *App) eventLoop() {
}
case ipc.EvError:
fyne.Do(func() {
msg := authErrorMessage(ev.Code, ev.Message)
if msg != "" {
showError(i18n.T("DlgAuthError"), msg, a.window)
if ev.Code == "tls_error" {
showError(i18n.T("DlgTLSError"),
i18n.T("TLSErrorVerification")+"\n\n"+ev.Message, a.window)
} else {
msg := authErrorMessage(ev.Code, ev.Message)
if msg != "" {
showError(i18n.T("DlgAuthError"), msg, a.window)
}
}
})
}