fix(ipsec): подтвердить сертификатный клиент и сообщать сбой истории

This commit is contained in:
Denozordec committed 2026-10-09 15:32:10 +07:00
1 parent b9a8615b8b
commit 5d9ef9dcf3
11 files changed
+176 -12

No files matched your search

+4 -1
View File
@@ -280,7 +280,10 @@ export function mapClients(state: IpsecServerState): IpsecClientDto[] {
const comment = identity?.comment ?? ""
const mcName = (identity?.["mode-config"] ?? "").trim()
const cn = String(cert["common-name"] ?? "").trim()
const active = (cn ? findActive(cn) : undefined)
// Our issued certificates have a single CN subject; match the whole DN, never a CN substring.
const singleCn = cn && !/[,+=<>;\\"\u0000]/.test(cn) && state.certs.filter(c => c["common-name"] === cn).length === 1
? activeByRemote.get(`CN=${cn}`) : undefined
const active = (cn ? findActive(cn) : undefined) ?? singleCn
?? (identity?.["remote-id"] ? findActive(String(identity["remote-id"]).trim()) : undefined)
out.push({
id: `${server.id}:${identity ? "identity" : "cert"}:${String(identity?.[".id"] ?? cert[".id"] ?? certName)}`,