Keystore not working in tomcat

Dear all,

I followed this are steps :-
keytool -keysize 2048 -genkey -alias tomcat -keyalg RSA -keystore ./domain.keystore

keytool -certreq -keyalg RSA -alias tomcat -file ./domain.csr -keystore ./domain.keystore

keytool -import -trustcacerts -alias AddTrustExternalCARoot -file AddTrustExternalCARoot.crt -keystore ./domain.keystore

keytool -import -trustcacerts -alias tomcat -file domain.crt -keystore ./domain.keystore

getting error :- keytool error: java.lang.Exception: Public keys in reply and keystore don’t match

then I run

keytool -importcert -alias comodo -trustcacerts -file domain.crt -keystore ./domain.keystore

Asking for yes or no I pressed Yes

Attach this keystore file with tomcat then run https://domain:8443 showing Untrusted

So please help me.

I advice you to use keyStore explorer graphical tool to generate keystore/certificate and for importing/exporting certificate into keystore.

Hi Ravi,

I try this one but not working.


Hi Ravi,

I solved this issue using comodo Knowledge-base ,I forward this are links for reference :-


Thanks for sharing the reference links, hope it will help others who face similar problems…