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​
- Make sure that the proxy server is enabled.
- Open the Chrome and access https://testcloud.katalon.com/healthcheck.
- Export and download the certificate chain as follows:
- Click the lock icon from URL address bar.
- Select Connection is secure > Certificate is valid.
- In the Certificate Viewer dialog, select the Details tab then Export.
- Save the certificate in the “Base64-encoded ASCII, certificate chain” format.
- 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​
- 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.
-
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.
-
Copy the following command to the CLI, replace the
PATH TO CERTIFICATEwith 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 -
After clicking enter, it will ask for a password which you need to set as
changeit. -
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.