IntelliJ Plugin: Connection failed, unable to find certification path to requested target.

  • Updated

Issue

When I configure the contrast Plugin for IntelliJ and finally I press the button "Add" I get this error message:
Connection failed! sun.security.validator.ValidatorException: PKIX path building failed:sun.security.provider.certpath.SunCertPathBuilderExceptions: unable to find certification path to requested target.
 

Cause

This message means that the certificate served up by the Contrast UI is not trusted by the JRE used by IntelliJ or, in the case of SaaS, it's likely that traffic from your system connects to the Contrast UI via a proxy and the proxy is rewriting the certificate. To resolve it, you must add the certificate to the Truststore that IntelliJ is using.

Resolution

1. In your browser, go to TeamServer and click on the padlock icon in the address bar to examine the certificate
2. Go to the **Details** tab
3. Click **Copy to File…,** then accept the default options with **Next -> Next** and now specify a location to save the certificate e.g. your Desktop
4. Find the folder where the IntelliJ Java is installed. This will usually be at **C:\Program Files\JetBrains\IntelliJ <version>\jre64\bin**
5. Open a Command Prompt window and change to the above path up to: **`cd C:\Program Files\JetBrains\IntelliJ <version>\jre64\bin`**
6. Use the keytool command to add the certificate to the Truststore
keytool.exe  -import -trustcacerts -noprompt -keystore ..\lib\security\cacerts -storepass changeit -alias ContrastTeamServer -file <path to .cer file saved from step 3>

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request