From 66808324868cd2c2d12d3a8f560ed2e27c75e3d0 Mon Sep 17 00:00:00 2001 From: proitlab Date: Tue, 23 Dec 2025 11:27:58 +0700 Subject: [PATCH] Allow self certificate accepts --- main.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.js b/main.js index 22a2dcc..6ac5b77 100644 --- a/main.js +++ b/main.js @@ -79,6 +79,19 @@ app.on('ready', async () => { createWindow(); + + app.on('certificate-error', (event, webContents, url, error, cert, callback) => { + // Verify the URL to ensure you only allow your intended self-signed certificate + if (url.startsWith('https://your-self-signed-domain.com')) { + // Prevent the default behavior (which is to reject the cert) + event.preventDefault(); + // Accept the certificate + callback(true); + } else { + // For all other URLs, let Chromium handle the error normally + callback(false); + } + }); // Quit app when all windows are closed, except on macOS (common pattern) app.on('window-all-closed', () => {