fix: wire gateway tls fingerprint for wss

This commit is contained in:
Peter Steinberger
2026-01-19 08:54:17 +00:00
parent 4609ed70c1
commit 66193dab92
2 changed files with 19 additions and 1 deletions

View File

@@ -99,7 +99,16 @@ export class GatewayClient {
typeof fingerprintValue === "string" ? fingerprintValue : "",
);
const expected = normalizeFingerprint(this.opts.tlsFingerprint ?? "");
return Boolean(fingerprint && fingerprint === expected);
if (!expected) {
return new Error("gateway tls fingerprint missing");
}
if (!fingerprint) {
return new Error("gateway tls fingerprint unavailable");
}
if (fingerprint !== expected) {
return new Error("gateway tls fingerprint mismatch");
}
return undefined;
};
}
this.ws = new WebSocket(url, wsOptions);