From f86331ff938504699225ccbeec14ceca7545956a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Cie=C5=9Blak?= Date: Wed, 23 Oct 2024 11:49:57 +0200 Subject: [PATCH] Turn off HTTPS of Vite's dev server in Connect --- .../teleterm/electron.vite.config.mts | 26 ------------------- .../src/mainProcess/windowsManager.ts | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/web/packages/teleterm/electron.vite.config.mts b/web/packages/teleterm/electron.vite.config.mts index 42a7d81eb44d6..926fc20b307cb 100644 --- a/web/packages/teleterm/electron.vite.config.mts +++ b/web/packages/teleterm/electron.vite.config.mts @@ -17,7 +17,6 @@ */ import path from 'node:path'; -import { existsSync, readFileSync } from 'node:fs'; import { defineConfig, externalizeDepsPlugin, UserConfig } from 'electron-vite'; @@ -120,31 +119,6 @@ const config = defineConfig(env => { }, }; - if (env.mode === 'development') { - if (process.env.VITE_HTTPS_KEY && process.env.VITE_HTTPS_CERT) { - config.renderer.server.https = { - key: readFileSync(process.env.VITE_HTTPS_KEY), - cert: readFileSync(process.env.VITE_HTTPS_CERT), - }; - } else { - const certsDirectory = path.resolve(rootDirectory, 'web/certs'); - - if (!existsSync(certsDirectory)) { - throw new Error( - 'Could not find SSL certificates. Please follow web/README.md to generate certificates.' - ); - } - - const keyPath = path.resolve(certsDirectory, 'server.key'); - const certPath = path.resolve(certsDirectory, 'server.crt'); - - config.renderer.server.https = { - key: readFileSync(keyPath), - cert: readFileSync(certPath), - }; - } - } - return config; }); diff --git a/web/packages/teleterm/src/mainProcess/windowsManager.ts b/web/packages/teleterm/src/mainProcess/windowsManager.ts index daa0935122c4c..513e31573400c 100644 --- a/web/packages/teleterm/src/mainProcess/windowsManager.ts +++ b/web/packages/teleterm/src/mainProcess/windowsManager.ts @@ -362,7 +362,7 @@ export class WindowsManager { * */ function getWindowUrl(isDev: boolean): string { if (isDev) { - return 'https://localhost:8080/'; + return 'http://localhost:8080/'; } // The returned URL is percent-encoded.