update setCertificateVerifyProc example
setCertificateVerifyProc example should reflect new api
This commit is contained in:
parent
92092bed41
commit
c4280612c1
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue