Skip to content

Image features

Adding a custom root certification authority

Section titled “Adding a custom root certification authority”

In corporate networks, tested environments often use self-signed TLS certificates issued by a root certification authority that browsers do not know. A browser refuses such a page with “Your connection is not private”. The acceptInsecureCerts capability ignores certificate errors, but it does not help when the page uses HSTS.

To work properly, add your root certificate to the trusted list. These images accept it through an environment variable. For a certificate in cert.pem:

  1. Encode it as Base64:

    Terminal window
    CERT_CONTENTS=$(cat cert.pem | base64 -w0)

    On macOS:

    Terminal window
    CERT_CONTENTS=$(cat cert.pem | base64)
  2. Pass it to the browser image:

    ROOT_CA_<cert-name>="$CERT_CONTENTS"

    <cert-name> becomes the certificate name in the browser’s certificate store, for example ROOT_CA_MY_CERT="LS0tL....==".

Using a custom browser profile with Chrome

Section titled “Using a custom browser profile with Chrome”

When launching Chrome with a custom profile directory, DevTools will not work unless you also set BROWSER_PROFILE_DIR:

{
"capabilities": {
"alwaysMatch": {
"browserName": "chrome",
"browserVersion": "152.0",
"goog:chromeOptions": {
"args": [ "user-data-dir=/profiles/custom.XYZ" ]
},
"websummoner:options": {
"env": [ "BROWSER_PROFILE_DIR=/profiles/custom.XYZ" ]
}
}
}
}