Merge pull request #8731 from herrmannplatz/patch-1
update setCertificateVerifyProc example
This commit is contained in:
commit
85bdce0722
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue