3

I am auto-selecting a certificate for Chrome on MacOS using the following preference file:

<plist version="1.0″>
<dict>
  <key>AutoSelectCertificateForUrls</key>
   <array>
     <string>{"pattern":"[*.]my.url.net","filter":{"ISSUER":{"CN":"CERT CA"}}}</string>
   </array>
</dict>
</plist>

It works great, but when I try to run my tests on Chrome using headless mode it doesn't seem to auto-select the certificate.

Does anyone know how to get to this to work? I am using the following ChromeOptions:

'chromeOptions': {
      'args': ['--ignore-certificate-errors', '--headless', '--disable-gpu', '--no-sandbox']
}
OhWhenELC
  • 31
  • 1
  • 2

1 Answers1

1

Policy configuration is not supported by headless chrome, if headless firefox is an option you can use fireFoxOptions to use profiles where you can add certificates. I needed to auto select certificates and manage to do it only with headless firefox. Open default firefox, setup your profile and then point to it on code if you dont want to do it manually.

FirefoxOptions options = new FirefoxOptions();
FirefoxProfile firefoxProfile = new FirefoxProfile(@"C:\Users\....\AppData\Roaming\Mozilla\Firefox\Profiles\...default");
options.Profile = firefoxProfile;
Cadudragon
  • 51
  • 3