Allow self certificate accepts
This commit is contained in:
13
main.js
13
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', () => {
|
||||
|
||||
Reference in New Issue
Block a user