From 2ab06c9f53e474287a81735b0d35aef41cc27690 Mon Sep 17 00:00:00 2001 From: John Davis Date: Mon, 18 Nov 2024 14:25:24 +0000 Subject: [PATCH] surface disable fingerprint verification --- API.md | 1 + src/cpp/peer-connection-wrapper.cpp | 5 +++++ src/lib/types.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/API.md b/API.md index 1dd24f1..e95f9a9 100644 --- a/API.md +++ b/API.md @@ -21,6 +21,7 @@ export interface RtcConfig { maxMessageSize?: number; mtu?: number; iceTransportPolicy?: TransportPolicy; + disableFingerprintVerification?: boolean; } export const enum RelayType { diff --git a/src/cpp/peer-connection-wrapper.cpp b/src/cpp/peer-connection-wrapper.cpp index bff1074..d24b32b 100644 --- a/src/cpp/peer-connection-wrapper.cpp +++ b/src/cpp/peer-connection-wrapper.cpp @@ -242,6 +242,11 @@ PeerConnectionWrapper::PeerConnectionWrapper(const Napi::CallbackInfo &info) : N } } + // Allow skipping fingerprint validation + if (config.Get("disableFingerprintVerification").IsBoolean()) { + rtcConfig.disableFingerprintVerification = config.Get("disableFingerprintVerification").As(); + } + // Create peer-connection try { diff --git a/src/lib/types.ts b/src/lib/types.ts index 12c1606..66dfdbc 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -76,6 +76,7 @@ export interface RtcConfig { maxMessageSize?: number; mtu?: number; iceTransportPolicy?: TransportPolicy; + disableFingerprintVerification?: boolean; } // Lowercase to match the description type string from libdatachannel