Jelastic cloud connection failed

I am trying to connect MirHost of Jelastic cloud but it is failed with the following exceptions


[00:37:35.475] Connection failed
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Hi,

The issue with MirHosting SSL certificate is known. We hope, it is going to be fixed soon.

The certificate is not included to Java cacerts by default. So Java applications (including Studio) could not work with MirHosting API.

There are two ways to work around the issue:

The easiest is to build WAR using Studio and deploy the application using Jelastic administration panel.

When Jelastic deployment is configured launch the jelasticBuildWar Gradle task. As a result, “Jelastic ready” WAR will be generated in the ${project_root}/build/distributions/war folder.

The second way is a bit complicated but enables Studio to work with MirHosting. The certificate could be added to trusted certs of your local Java installation. How to do it:

  1. download the following pair of certs (MirHosting uses them at the moment): https://www.startssl.com/certs/ca-g2.crt ; https://www.startssl.com/certs/ca-sha2.crt

  2. (not necessary, useful for me) move them to jdk/jre/lib/security of your Java installation

  3. start command line with superuser rights, CD to the folder

  4. execute


 keytool -import -alias mirhost -keystore cacerts -file ca-g2.crt
 keytool -import -alias mirhostsha  -keystore cacerts -file  ca-sha2.crt 

The default password for cacerts is changeit, add certs to trusted.

  1. exit the Studio and start it again

jelasticBuildWar