How do I trust a self signed certificate from an electron app from the main process, using the `electron.net` API?

Viewed 841

The goal is to customise certificate validation from within the main process of an electron app, for the use with self-signed certificates and non-matching hostnames in development and testing conditions. The electron.net API provides the option to supply a Session object, which has a setCertificateVerifyProc method. However, the callback I register using that method never gets called.

There is a related question here: How do I trust a self signed certificate from an electron app? However, the accepted answer from that question only works in a render process. Indeed, on the main process, the event certificate-error is never issued.

0 Answers
Related