Today I got an error when running a Java application on a new CentOS server:
1
| SunCertPathBuilderException: unable to find valid certification path to requested target
|
Here is the solution.
From here and here.
Download the “InstallCert.java” file from here.
Run it as below:
1 2 3 4 5 6 7 8 9
| javac InstallCert.java
java InstallCert [host]:[port]
keytool -exportcert -alias [host]-1 -keystore jssecacerts -storepass changeit -file [host].cer
keytool -importcert -alias [host] -keystore [path to system keystore] -storepass changeit -file [host].cer
|