Skip to content

Commit

Permalink
Turn off HTTPS of Vite's dev server in Connect
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicious authored and github-actions committed Oct 23, 2024
1 parent 4ac589f commit 0c84f81
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
26 changes: 0 additions & 26 deletions web/packages/teleterm/electron.vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

import path from 'node:path';
import { existsSync, readFileSync } from 'node:fs';

import { defineConfig, externalizeDepsPlugin, UserConfig } from 'electron-vite';

Expand Down Expand Up @@ -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;
});

Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleterm/src/mainProcess/windowsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0c84f81

Please sign in to comment.