update setCertificateVerifyProc example

setCertificateVerifyProc example should reflect new api
This commit is contained in:
René Herrmann 2017-02-22 11:49:14 +01:00 committed by GitHub
parent 92092bed41
commit c4280612c1

View file

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