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')
|
||||
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