diff --git a/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js b/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js index 903ba846f7..3ed05d45c6 100644 --- a/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js +++ b/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js @@ -1,4 +1,5 @@ const { BrowserWindow } = require('electron'); +const { preferencesUtil } = require('../../store/preferences'); const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => { return new Promise(async (resolve, reject) => { @@ -22,6 +23,12 @@ const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => { }); window.on('ready-to-show', window.show.bind(window)); + // We want browser window to comply with "SSL/TLS Certificate Verification" toggle in Preferences + window.webContents.on('certificate-error', (event, url, error, certificate, callback) => { + event.preventDefault(); + callback(!preferencesUtil.shouldVerifyTls()); + }); + function onWindowRedirect(url) { // check if the url contains an authorization code if (new URL(url).searchParams.has('code')) {