From a64b2c0a08897da9f3c0c31e228b5f965417c4ab Mon Sep 17 00:00:00 2001 From: Adam Obuchowicz Date: Mon, 29 Jul 2024 17:00:50 +0200 Subject: [PATCH] Remove unnecessary chrome flags (#10619) Fixes #10487 During my tests, these flags were not needed; without them, electron app displays exactly the same cert warnings as with them: ``` Loading the window address 'https://localhost:8080/?engine.projectManagerUrl=ws%3A%2F%2F127.0.0.1%3A30535'. [30750:0722/121629.281911:ERROR:cert_verify_proc_builtin.cc(1051)] CertVerifyProcBuiltin for localhost failed: ----- Certificate i=0 (CN=127.0.0.1) ----- ERROR: No matching issuer found ``` in CLI and ![Screenshot from 2024-07-22 10-13-12](https://github.com/user-attachments/assets/82a73c9a-ca46-4880-b94e-e979d30ae97c) in web console. --- app/ide-desktop/client/src/index.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/app/ide-desktop/client/src/index.ts b/app/ide-desktop/client/src/index.ts index 1afe4248683..f6792d535f0 100644 --- a/app/ide-desktop/client/src/index.ts +++ b/app/ide-desktop/client/src/index.ts @@ -68,20 +68,6 @@ class App { } }) - electron.app.commandLine.appendSwitch('allow-insecure-localhost', 'true') - electron.app.commandLine.appendSwitch('ignore-certificate-errors', 'true') - electron.app.commandLine.appendSwitch('ignore-ssl-errors', 'true') - electron.app.commandLine.appendSwitch('ignore-certificate-errors-spki-list', 'true') - electron.app.on( - 'certificate-error', - (event, _webContents, _url, _error, _certificate, callback) => { - // Prevent having error - event.preventDefault() - // and continue - callback(true) - }, - ) - const { windowSize, chromeOptions, fileToOpen, urlToOpen } = this.processArguments() if (this.args.options.version.value) { await this.printVersion() @@ -226,10 +212,8 @@ class App { } logger.groupMeasured('Setting Chrome options', () => { const perfOpts = this.args.groups.performance.options - add('ignore-certificate-errors-spki-list') - add('allow-insecure-localhost') + // Needed to accept localhost self-signed cert add('ignore-certificate-errors') - add('ignore-ssl-errors') addIf(perfOpts.disableGpuSandbox, 'disable-gpu-sandbox') addIf(perfOpts.disableGpuVsync, 'disable-gpu-vsync') addIf(perfOpts.disableSandbox, 'no-sandbox')