Selenium Chrome suppress/dismiss client certificate selection dialog Selenium Chrome suppress/dismiss client certificate selection dialog selenium selenium

Selenium Chrome suppress/dismiss client certificate selection dialog


I found a solution to this problem:You must use chrome parameter - AutoSelectCertificateForUrls

Add this to the windows registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls\1 = "{"pattern":"https://yoursite.com","filter":{}}"


In linux you need this file set:

$HOME/etc/opt/chrome/policies/managed/auto_select_certificate.json

With this content:

{  "AutoSelectCertificateForUrls": [ "{\"pattern\":\"*\",\"filter\":{}}" ]}

With this set it should allow every installed client certificate automatically.

Detailed article about how to solve it in C# with Docker can be found in an article I wrote here:https://sgedda.medium.com/running-selenium-with-chromedriver-together-with-client-certificate-set-in-headful-mode-with-net-a79bde19e472


Try to launch chrome using "--ignore-certificate-errors" and "--ignore-urlfetcher-cert-requests" arguments.

ChromeOptions opts = new ChromeOptions();opts.addArguments("ignore-certificate-errors","ignore-urlfetcher-cert-requests");WebDriver driver = new ChromeDriver(opts);driver.get("http://www.google.com");System.out.println("Title:" + driver.getTitle());