Merge pull request #8731 from herrmannplatz/patch-1

update setCertificateVerifyProc example
This commit is contained in:
Kevin Sawicki 2017-02-22 08:22:21 -08:00 committed by GitHub
commit 85bdce0722

View file

@ -274,8 +274,13 @@ verify proc.
const {BrowserWindow} = require('electron') const {BrowserWindow} = require('electron')
let win = new BrowserWindow() let win = new BrowserWindow()
win.webContents.session.setCertificateVerifyProc((hostname, cert, callback) => { win.webContents.session.setCertificateVerifyProc((request, callback) => {
callback(hostname === 'github.com') const {hostname} = request
if (hostname === 'github.com') {
callback(0)
} else {
callback(-2)
}
}) })
``` ```