electron-root-ssl-pinning
Allows you to pin your own list of root CAs into your Electron application. If all you need is just to pin a leaf or an intermediate certificate, please use this awesome library.
Installation
yarn add electron-root-ssl-pinnning
Usage
Create verifier by passing a pathname to '*.pem' file
; const pathToCerts = path;const verifier = ;
Or create verifier by passing an array of root certificates
const verifier = ;
Usage of verifier
// your main.js file;// [...]const window = title: "Root CAs pinning test" width: 1300 height: 800 webPreferences: nodeIntegration: true ;// [...]sessiondefaultSession;// [...]
If you want to add a new root CA instead of replacing the entire default Chromium CA store
sessiondefaultSession;