fix(https-proxy): add error handling when using cached cert (#17628)

This commit is contained in:
Zach Bloomquist
2021-08-09 14:41:38 -04:00
committed by GitHub
parent ae0ea87802
commit 75746fb243
3 changed files with 97 additions and 17 deletions
+9
View File
@@ -183,6 +183,15 @@ class Server {
}
return this._getPortFor(hostname)
.catch(async (err) => {
debug('Error adding context, deleting certs and regenning %o', { hostname, err })
// files on disk can be corrupted, so try again
// @see https://github.com/cypress-io/cypress/issues/8705
await this._ca.clearDataForHostname(hostname)
return this._getPortFor(hostname)
})
.then((port) => {
sslServers[hostname] = { port }