Jan 4, 2018

How to solve: java.lang.Exception: Failed to establish chain from reply

Solution: Make sure all the certificates from the chain are imported into the keystore. And they have to be imported in order. If the order is incorrect, you need to delete it and import again according the right order: root certificate first, intermediate certificate second.

keytool -list -keystore keystore.jks shows you the existing certificates.

keytool -delete -alias s1as -keystore keystore.jks to delete certificate of alias s1as.

keytool -import -v -trustcacerts -alias root -file ~/gd_bundle-g2-g1.crt -keystore keystore.jks -keypass changeit -storepass changeit

keytool -import -v -trustcacerts -alias s1as -file ~/41188d108f1c8.crt -keystore keystore.jks -keypass changeit -storepass changeit

to import certificate of root and s1as respectively.

For Godaddy, you can check the chain order of the certificate here.

Verify your SSL certificate: