🎉 Introducing BrowserStack Website Scanner — a no-code tool to instantly scan, find, and fix critical website issues. Scan your site for free!

How can we help?

How to fix the “Connection failed due to certificate issue” error while recording tests?

If you encounter the Connection failed due to certificate issues error while recording tests, follow these steps to resolve it.

1. Add the BrowserStack Certificate to the Certificate Store

This issue could occur due to untrusted certificates. You will need to manually trust the BrowserStack certificate by exporting and importing it.

1.A. Export the BrowserStack Certificate

  1. Open https://www.browserstack.com/ URL in Chrome (or another browser).
  2. Click the padlock icon in the address bar to view site information.
  3. Select Connection is secure (or similar, depending on your browser).
  4. Click Certificate (Valid) to open the certificate details.
  5. In the certificate window, go to the Details tab.
  6. Click Copy to File... (Windows) or Export (macOS) and follow the prompts to save the certificate in .crt or .pem format.

1.B. Import the Certificate into the Certificate Store

On Windows:

  1. Open the Manage Computer Certificates window:
    1. Press Win + R, type certmgr.msc, and press Enter.
    2. Or search for certmgr.msc in the Windows Start menu.
  2. Choose the certificate store:
    1. Current User - for the current user only
    2. Local Machine - for all users (requires admin access)
  3. Import the certificate:
    1. Right-click Trusted Root Certification Authorities > All Tasks > Import.
    2. Browse to the .crt or .pem file and complete the import process.
  4. Verify that the certificate appears under Trusted Root Certification Authorities.

On macOS:

  1. Open Keychain Access (Cmd + Space, search for Keychain Access).
  2. Select System or Login under Keychains.
  3. Drag and drop the .crt or .pem file into the list.
  4. Double-click the certificate and expand Trust.
  5. Set "When using this certificate" to Always Trust.
  6. Close the window and enter your password to save changes.

2. Pass the SSL Certificate Chain in Configuration

Another solution is to pass the SSL certificate chain in the configuration file, by following these steps:

  1. Follow the same export steps as in 1A.
  2. While exporting, choose the option int he dropdown to download the entire certificate chain (not just the root certificate).

Update the config.json as follows:

{
    "loggingLevel": "info",
    "proxy": {
        "sslCertPath": "<path to cert>"
    }
}

3. Disable SSL Inspection for the BrowserStack Network

SSL inspection by your organization's firewall/proxy may block connections. You may need to exclude BrowserStack domains by following these steps:

  1. Contact your IT/network administrator and request an exclusion for BrowserStack domains from SSL inspection. Domains that need to be excluded are : 
    1. *.browserstack.com
    2. *.percy.io
  2. Adjust security settings in your firewall or proxy to allow direct access to BrowserStack.
  3. Restart your application and check if the issue is resolved.

4. Modify Configuration to Ignore SSL Warnings

If SSL inspection is enabled, update the config.json file to bypass SSL warnings.

File Locations:

- On Windows: C:\Users\<username>\.lca\config.json

- On macOS: /Users/<username>/.lca/config.json

Replace <username> with your system username.

Steps to update the configuration to bypass SSL warnings:

  1. Open the config.json file from the above location.
  2. Add the following configuration to the config.json file:
    {
        "loggingLevel": "info",
        "proxy": {
            "ignoreSSLWarning": true
        }
    }
  3. Save the file.
  4. Restart the application for changes to take effect.

If you have tried the above solutions and are still unable to resolve the issue, please contact our Support team for further assistance.


Other Resources

Still can’t find what you are looking for?

We are always happy to help with any questions

Support resources Contact Us