Sunday 29 April 2018

How to Avoid Certificate Popups to enable smooth Automation


Certificate Popups are common in a secured environment or while accessing the internal applications. It is a basically a way to authenticate the users accessing the application.

Yes, I know..! This is annoying for automation testers.
To overcome this annoying feature and yet without compromising on security, we have to make certain settings on each browser. These settings enable us to have smooth automation.

The fix is very simple, let the browser know which certificate to select as default one. Thus stops asking you for a client certificate. Follow the settings mentioned below based on the browser:

NOTE: 
  1. This approach will help when you have no or only single certificate added to browser.
  2. This approach is tested on windows OS.

Mozilla Firefox:

Step 1: Import Certificate

  1. Open Firefox > Options > Certificates > View Certificates > Your Certificates.
  2. Click Import & follow instructions to import a certificate(*.pfx)
  3. After Import, Success Message will be popped up.


Step 2: Browser settings to select the default Certificate

  1. Open Firefox > Options > Certificates
  2. Under Certificates section, Select the radio button next to 'Select one automatically'.


Google Chrome:

Step 1: Import Certificate

  1. Open Google Chrome > Menu > Settings > Manage Certificates.
  2. Click Import on 'Personal' tab & follow instructions to import a certificate(*.pfx)
  3. After Import, Success Message will be popped up.

Step 2: Registry settings to select the default Certificate

  1. Get to know the Certificate Issuing Authority from the Certificate details in the browser.
  2. Edit the ‘ISSUER’ node in the below text & save it as registry / ‘.reg’ file.
  3. Double click the ‘.reg’ file and accept the confirmation dialogue, if asked for.
  4. Registry Entry Success message would pop-up.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls]
"1"="{\"pattern\":\"*\",\"filter\":{\"ISSUER\":{\"CN\":\"ClientCA\"}}}"


Microsoft Edge:

Step 1: Import Certificate

Step 2: Registry settings to select the default certificate

  1. Get to know the Certificate Issuing Authority from the Certificate details in the browser.
  2. Edit the ‘ISSUER’ node in the below text & save it as registry / ‘.reg’ file.
  3. Double click the ‘.reg’ file and accept the confirmation dialogue, if asked for.
  4. Registry Entry Success message would pop-up.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\AutoSelectCertificateForUrls]
"1"="{\"pattern\":\"*\",\"filter\":{\"ISSUER\":{\"CN\":\"ClientCA\"}}}"


Internet Explorer:

Step 1: Import Certificate

Step 2: Browser settings to select the default Certificate

  1. Open Internet Explorer > Tools > Internet Options
  2. Select 'Security' Tab
  3. Select the Zone associated with the website.
  4. Click on 'Custom Level...'
  5. Look for option 'Don't prompt for client certificate selection when no certificates or only one certificate exists' option 
  6. Check or enable that option.
  7. Restart the browser.


References:



3 comments: