<p>I am deploying sample springboot application using fabric8 maven deploy. The build fails with SSLHandshakeException.</p>

<pre><code>F8: Cannot access cluster for detecting mode: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Failed to execute goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build (default) on project fuse-camel-sb-rest: Execution default of goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build failed: An error has occurred. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -&gt; [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build (default) on project fuse-camel-sb-rest: Execution default of goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build failed: An error has occurred.
</code></pre>

<p>So, I downloaded the public certificate from the Openshift webconsole and added it to JVM using </p>

<pre><code>C:\...\jdk.\bin&gt;keytool -import -alias rootcert -file C:\sample\RootCert.cer -keystore cacerts
</code></pre>

<p>and got message that its successfully added to the keystore and the list command shows the certificates added.</p>

<pre><code>    C:\...\jdk.\bin&gt;keytool -list -keystore cacerts
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN

Your keystore contains 2 entries

rootcert, May 18, 2018, trustedCertEntry,
Certificate fingerprint (SHA1): XX:XX:XX:..........
</code></pre>

<p>But the mvn:fabric8 deploy build still fails with the same exception.</p>

<p>Can someone shed some light on this issue? Am I missing anything?</p>

<p>Jack's solution works fine on Windows. I exported certificate from webrowser, when I was on openshift webconsole. Then I added cert to cacerts in $JAVAHOME/jre/lib/security:
 keytool -import -alias my.alias -file C:\sample\RootCert.cer -keystore cacerts</p>
