Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix comment

Thiago Araujo da Silva7170b807b8b6
diff --git a/backend/src/lib/tls/index.ts b/backend/src/lib/tls/index.ts
index bb759e4b2a..612ed054b0 100644
--- a/backend/src/lib/tls/index.ts
+++ b/backend/src/lib/tls/index.ts
@@ -1,9 +1,10 @@
import { isIP } from "node:net";
import tls from "node:tls";
-// Node 26 throws when servername is an IP (SNI cannot carry one, RFC 6066). Earlier versions skipped the
-// SNI but still verified the certificate against that IP, so keep the check: many callers dial a local
-// gateway proxy, where Node would otherwise verify against "localhost".
+// Node 26 throws when servername is an IP (SNI cannot carry one, RFC 6066). Earlier versions still sent the
+// IP as SNI, so omitting it changes what the server sees (no SNI, or "localhost" from an https.Agent with no
+// Host header). Keep the certificate check against the IP: many callers dial a local gateway proxy, where
+// Node would otherwise verify against "localhost".
export const getTlsServerNameOptions = (
host?: string
): Pick<tls.ConnectionOptions, "servername" | "checkServerIdentity"> => {