• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
10 views

Problem :

I am getting bellow error while using keytool

keytool error: java.lang.exception: public keys in reply and keystore don't match

by (6.9k points)  
edited by

1 Answer

0 votes

Solution:

The three certificates that we need to look at are probably:

  1. The SSL cert of the web service
  2. The CA cert that signed by the SSL cert
  3. The root cert that signed the CA

now you need  to add a trust anchor to your truststore by default: ${JAVA_HOME}/jre/lib/security/cacerts), with this result your client accepts the SSL certificate of the webservice.

Now you need to add the root certificate to your truststore:

keytool -import -keystore ${JAVA_HOME}/jre/lib/security/cacerts -file CCA_Certificate.cer -alias theCCARoot

Further Readings:

https://community.oracle.com/thread/1533940

by (22.5k points)  
edited by
...