Skip to main content

Unable to find valid certification path to request target

Condition & Cause​

You encounter the error message “PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target“ when running with TestCloud.

This issue can come from any cloud-based platform like TestCloud, Browserstack, SauceLabs, etc.. that Katalon Studio is trying to connect with. It happens due to the user’s security system overriding the default certificate for the Cloud platform, which then restricts Katalon Studio to connect with the platform.

Solution​

You need to download the cert chain from the browser (Chrome/Firefox) and import it into the Local System Trusted Store.

Export and download the certificate chain from the browser​

  1. Make sure that the proxy server is enabled.
  2. Open the Chrome and access https://testcloud.katalon.com/healthcheck.
  3. Export and download the certificate chain as follows:
    1. Click the lock icon from URL address bar.
    2. Select Connection is secure > Certificate is valid.
    Select Connection is secure
    1. In the Certificate Viewer dialog, select the Details tab then Export.
    Select the Details tab
    1. Save the certificate in the “Base64-encoded ASCII, certificate chain” format.
    Download certificate
    1. Copy the file path of the downloaded certificate in your local machine and store it for later.

Install the certificate into Local System Trusted Store​

Permission Required
  • To complete this action, the system must access the Trusted Root Certification Authorities store. Please run the application with administrator privileges to allow access to the local system certificate store.
  1. Navigate to the following file location:

    • MacOS: Katalon Studio Contents folder > Eclipse > jre and open a new Terminal at the bin folder.
    • Windows: Katalon Studio application folder > jre > bin and open the folder in Command Prompt.
  2. Copy the following command to the CLI, replace the PATH TO CERTIFICATE with the certificate file path and click Enter:

    • Windows:
    keytool -importcert -alias katalon -file "PATH TO CERTIFICATE" -keystore ../lib/security/cacerts
    • MacOS:
    keytool -import -trustcacerts -file "PATH TO CERTIFICATE" -alias katalon -keystore ./lib/security/cacerts
  3. After clicking enter, it will ask for a password which you need to set as changeit.

  4. Click enter again, it will ask to trust this certificate. Input Yes.

Result​

You should see from the CLI window: "Certificate was added to keystore". Restart Katalon Studio and run the tests again with your selected cloud platform.

Was this page helpful?