Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(tls): trust OS CA store for Node-side TLS; keep realtime WS on OpenAI only (#657)

Gabriel Steinfe1f74a06b43
diff --git a/main.js b/main.js
index 4c1186319..ce753f9bd 100644
--- a/main.js
+++ b/main.js
@@ -28,8 +28,23 @@ const {
} = require("electron");
const path = require("path");
const http = require("http");
+const tls = require("tls");
require("dotenv").config({ path: path.join(__dirname, ".env") });
+// Extend Node's TLS trust with the OS store so ws and https.get see corporate
+// CAs that Chromium already trusts.
+try {
+ const currentCAs = tls.getCACertificates();
+ const systemCAs = tls.getCACertificates("system");
+ if (systemCAs?.length) {
+ tls.setDefaultCACertificates([...currentCAs, ...systemCAs]);
+ }
+} catch (err) {
+ require("./src/helpers/debugLogger").warn("System CA merge failed; using existing CA list", {
+ error: err?.message,
+ });
+}
+
const VALID_CHANNELS = new Set(["development", "staging", "production"]);
const DEFAULT_OAUTH_PROTOCOL_BY_CHANNEL = {
development: "openwhispr-dev",
diff --git a/src/helpers/audioManager.js b/src/helpers/audioManager.js
index d14ad0474..b2da10f15 100644
--- a/src/helpers/audioManager.js
+++ b/src/helpers/audioManager.js
@@ -1964,6 +1964,8 @@ registerProcessor("pcm-streaming-processor", PCMStreamingProcessor);
}
if (REALTIME_MODELS.has(s.cloudTranscriptionModel)) {
+ // Realtime WS is OpenAI-only — other providers fall through to HTTP.
+ if ((s.cloudTranscriptionProvider || "openai") !== "openai") return false;
if (s.cloudTranscriptionMode === "byok") return !!s.openaiApiKey;
if (s.cloudTranscriptionMode === "openwhispr") return !!(isSignedInOverride ?? s.isSignedIn);
return false;