2016-08-17 28 views

回答

3

訂閱由app模塊發出的certificate-error事件,並確認在事件處理程序的自簽名的證書。

6

你需要把下面的代碼放到你的「殼」(核心電子INIT)文件:

// SSL/TSL: this is the self signed certificate support 
    app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { 
     // On certificate error we disable default behaviour (stop loading the page) 
     // and we then say "it is all fine - true" to the callback 
     event.preventDefault(); 
     callback(true); 
    }); 

但是,這允許你喜歡自我不安全(無效)證書籤名的一個。

請注意,這不是連接到服務器的安全方式。

欲瞭解更多,你可以檢查文件:https://electron.atom.io/docs/api/app/#event-certificate-error

相關問題