Thursday, September 21, 2023

Automatic client certificate choosing in browsers

 Long time, no see!!

If you have some corporate websites that require you to present a client certificate to access them, browsers are set to make you select the certificate EVERY TIME YOU ACCESS THE SITE, even if you only have one personal certificate.

To change this you can use:

MS Edge @ Windows (should be similar for Chrome, did not test)

Add a reg key at
Computer\HKEY_CURRENT_USER\Software\Policies\Microsoft\Edge\AutoSelectCertificateForUrls
Then add one entry per domain to match

There are GPOs to make this more Corporate IT friendly.

Chrome @ Mac

Execute the following on a terminal

defaults write com.google.Chrome AutoSelectCertificateForUrls -array
defaults write com.google.Chrome AutoSelectCertificateForUrls -array-add -string '
[
  { "pattern": "[*.]domain.tld", "filter": { "ISSUER": { "CN": "<issuer name>" } } }
]
'

Add one "pattern" line in the json array per domain to match.

Firefox (OS independent, AFAIK)

in "about:config"
define 'security.default_personal_cert' as "Select Automatically".