Commit 8f486945 authored by John Chen's avatar John Chen Committed by Commit Bot

[ChromeDriver] Stop using --ignore-certificate-errors

ChromeDriver was passing --ignore-certificate-errors switch to Chrome,
regardless of whether user wants to ignore certificate errors or not.
Fixing by stop passing this flag to Chrome, and relying on using
Security.setIgnoreCertificateErrors command when user wants to ignore
certificate errors.

Bug: chromedriver:3148
Change-Id: I5e8493f4cca48ebaeb211c95cd7fd645891c8659
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824005Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699890}
parent 12893bb6
......@@ -429,14 +429,8 @@ Status ChromeImpl::SetAcceptInsecureCerts() {
base::DictionaryValue params;
params.SetBoolean("ignore", true);
// We ignore the status returned by this command - If it is an error, the
// target likely doesn't yet support the command. In that case, we'll fall
// back to --ignore-certificate-errors.
// TODO(eseckler): Handle status once we remove support for
// --ignore-certificate-errors.
devtools_websocket_client_->SendCommand("Security.setIgnoreCertificateErrors",
params);
return Status(kOk);
return devtools_websocket_client_->SendCommand(
"Security.setIgnoreCertificateErrors", params);
}
Status ChromeImpl::SetPermission(
......
......@@ -69,10 +69,9 @@
namespace {
// TODO(eseckler): Remove --ignore-certificate-errors for newer Chrome versions
// that support the Security DevTools domain on the browser target.
const char* const kCommonSwitches[] = {
"disable-popup-blocking", "enable-automation", "ignore-certificate-errors",
"disable-popup-blocking",
"enable-automation",
};
const char* const kDesktopSwitches[] = {
......
......@@ -2379,6 +2379,7 @@ class ChromeDriverSecureContextTest(ChromeDriverBaseTestWithWebServer):
def setUp(self):
self._driver = self.CreateDriver(
accept_insecure_certs=True,
chrome_switches=['host-resolver-rules=MAP * 127.0.0.1'])
def testAddVirtualAuthenticator(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment