Chrome - How to select a specific PKI certificate based on profile

0 votes

How to select a specific PKI certificate based on profile? I am writing Selenium WebDriver scripts to test applications that require user PKI certificates for validation of user access and privileges. I have been able to write the code to select any one of 5 different user test certificates that I desire.

My problem is that, once I have selected the correct user profile, I can't find a way to select the appropriate user PKI certificate that should go with that specific user profile. Here are the issues that I am facing.

  1. When using Chrome, and there is no recommended aPolicyFile.json in the /etc/opt/chrome/policies/recommended directory, I get a "Select a certificate" pop-up window that can not be accessed by WebDriver. So, I can't use automation to select from the list of all available certificates that have been installed.
  2. Chrome does not appear to have an ability to only present one certificate per profile. In Firefox, I just made 5 different profiles and only copied in one certificate per profile and and set the option for automatic certificate selection. Easy, right!
  3. When using Chrome, automatic certificate selection is done by using the policy feature. However, the policy feature allows you to select the first PKI certificate in your list of certificates based on a filter that you set. You can typically set the filter by Certificate Authority (ISSUER) or the user (SUBJECT). However, that has nothing to do with whatever profile your test suite is testing and will only select the first certificate based on that predetermined filter process. It does not address the Profile that is actually under test.

How do I use Java Selenium WebDriver to interact with Chrome and select the correct user profile and a specific PKI certificate based on the user profile selected for testing?

I can do it in Firefox by using the FirefoxProfile and FirefoxOptions classes that work effortlessly to test as many different test PKI certificates as any test suite needs without the need for tester intervention to select the proper PKI certificate at the beginning of each test.

Can you make a Chrome profile that only has access to one PKI certificate?

Can you select from a list of multiple PKI certificates based on the profile that has been used in your Java Selenium WebDriver automated test?

I have read the Chrome Policies lists and sections. I have read many Stack Overflow posts, How-To Geek articles etc. I can't find/figure out the right answer. Does anyone know how to do this?

Aug 14, 2021 in Selenium by Dave

edited Mar 4 29 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP