Skip to content
Prev Previous commit
Next Next commit
Use stable (but deprecated) Security.setOverrideCertificateErrors
Somehow this conflicts with redirectPass
  • Loading branch information
Janpot committed Mar 19, 2019
commit aefa83c84c543f5ee56d9eda1e42f62038b79a9f
12 changes: 11 additions & 1 deletion lighthouse-core/gather/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,17 @@ class Driver {
* @return {Promise<void>}
*/
async setIgnoreHttpsErrors() {
await this.sendCommand('Security.setIgnoreCertificateErrors', {ignore: true});
// the devtools protocol also has an experimental Security.setIgnoreCertificateErrors
// https://chromedevtools.github.io/devtools-protocol/tot/Security#method-setIgnoreCertificateErrors
// It can be used instead of the following when it becomes stable.
this.on('Security.certificateError', event => {
this.sendCommand('Security.handleCertificateError', {
eventId: event.eventId,
action: 'continue',
}).catch(err => log.warn('Driver', err));
});
await this.sendCommand('Security.enable');
await this.sendCommand('Security.setOverrideCertificateErrors', {override: true});
}
}

Expand Down