Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keytool cannot import certifiate - failed to establish chain from reply

I would really appreciate if someone could shed some light on the following issue. I have read the keytool documentation but could not find any hint regarding what could be the problem here.

I created a keystore

keytool -genkey -alias privateKeyName -keyalg RSA -keystore privateKeyName.jks -validity 720 -keysize 1024

I created a certificate request

keytool -certreq -alias privateKeyName -keystore privateKeyName.jks -file certReqFileName.csr

After the signing authority gave me the .cer file, I tried to import it with

keytool –import -alias privateKeyName -file certReqFileName_t_f.cer -keystore privateKeyName.jks

Import fails with

keytool error: java.lang.Exception: Failed to establish chain from reply

I have been stuck on this for some time now so any help would be awesome. Thanks.

like image 634
Nikola Kolev Avatar asked Nov 11 '12 17:11

Nikola Kolev


1 Answers

Take a look at the option -trustcacerts, if your CA is listed in the truststore. Additionally you may have to add the CA's intermediate certificates to your keystore, first.

like image 194
Andy Avatar answered Sep 20 '22 15:09

Andy