How can I suppress or automatically dismiss the client certificate selection dialog with selenium (chrome driver)?
I can't use this certificate, because it is stored on a chip card and I would have to enter a PIN. If no card is available, our website used a credential based login and I want to test this.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With