This page is solely intended for use with the Synthetic Private Agent. You will not be able to run some of the synthetic scripts below with the Synthetic Hosted Agent.

When using client certificates, you may need to select the certificate from a dialog. To do this, you will need to install the Python pyautogui library on the host machine of your Synthetic Private Agent. The pyautogui library enables you to navigate the UI to select a client certificate.

Install the PyAutoGUI Library

To install the PyAutoGUI Library:

  1. Log in to the host machine for the Synthetic Private Agent as the agent_user.
  2. Open a PowerShell console.
  3. Use pip to install the library: 

    Python

    > python -m pip install pyautogui

    Python 3

    > python3 -m pip install pyautogui

Select the Only Client Certificate

When you manually navigate to a site that uses client certification, IE10 may prompt you with an alert dialog to select one client certificates as seen below:

Confirm Certificate

To select the client certificate from a synthetic script, your code could focus on the alert dialog and accept the given client certificate as performed by the synthetic script below.

sslUrl = "https://yourdomain.com/"
driver.get(sslUrl)
# Move focus to the dialog
alert = driver.switch_to_alert()
# Accept the client cert
alert.accept()
PY

Select Certificate from List

In the case where your synthetic job needs to select one client certificate from a list presented in the alert dialog as shown below, you can use the PyAutoGUI Library to select and accept the client certificate that you want. 

Confirm Certificate

In the example below, you use switch_to_alert to focus on the alert dialog, and then use the pyautogui library to navigate to the correct certificate (tab), select it (enter), and then navigate to the OK button to select it (tab, enter). 

import pyautogui
pyautogui.FAILSAFE = False
sslUrl = "https://yourdomain.com/"
driver.get(sslUrl)
driver.switch_to_alert()
pyautogui.press(['tab', 'enter', 'tab', 'enter'])
PY

You may have many more client certificates to choose from, so you will have to figure out the best way to use the PyAutoGUI APIs to navigate around the alert dialogue to select and accept the correct client certificate. See Keyboard Control Functions in the PyAutoGUI documentation for more information.