Allow self certificate accepts
This commit is contained in:
1 parent
c8ae8757fc
commit
6680832486
1 file changed
+13
@@ -80,6 +80,19 @@ app.on('ready', async () => {
|
|||||||
createWindow();
|
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)
|
// Quit app when all windows are closed, except on macOS (common pattern)
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
|
|||||||
Reference in new issue
Block a user