How to handle "PKIX ... invalid certification path" errors occurring in the Squish IDE

Last edited on

Problems the user sees

Message: Error installing the AI Assistant feature
java.lang.reflect.InvocationTargetException: Submission of ToS approval failed

[...]
Caused by: java.io.IOException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[...]
Validating the SSL certificate of Squish Test Center at https://testcenter.example.com failed: sun.security.provider.certpath.SunCertPathBuilderException

Possible cause

The SSL/TLS implementation used for HTTPS network access in the Squish IDE shows errors listed above when it fails to verify a self-signed SSL/TLS certificate, because such certificate is not signed by a recognized certification authority (CA).

Solution

If you trust the HTTPS server/proxy, you may manually import its SSL/TLS certificate into the appropriate certificate store so that applications can validate the HTTPS connection without warnings or failures. For Java applications, this certificate store is a part of their Java Runtime Environment (JRE).

The Squish IDE is a Java application that comes with its own JRE. It is therefore necessary to locate the JRE certificate store inside the Squish installation folder and import the self-signed SSL/TLS certificate into it. An SSL/TLS certificate is usually a file with .pem, .crt, .p12 or .pfx extension; if you don't have it at hand, contact your IT department.

To import the SSL/TLS certificate into the Squish IDE's JRE certificate store so that it is seen and trusted by the IDE, descend into the folder with Java keytool executable:

Once in the folder, execute the following sequence of commands in a terminal or command-line:

# use JRE keytool to import the self-signed certificate (file: my_cert.pem)
./keytool -importcert -trustcacerts -cacerts -file /path/to/my_cert.pem -alias myCustomAlias

# verify import succeeded: list certificates with the given alias in Squish IDE's JRE keystore
./keytool -list -keystore ../../jre/lib/security/cacerts -alias myCustomAlias