mirror of
https://github.com/electron/electron.git
synced 2026-01-26 15:58:07 -05:00
Merge pull request #8731 from herrmannplatz/patch-1
update setCertificateVerifyProc example
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user