I have to access a webservice hosted at port 443.Service provider has shared three certificate with us.
- ABCD.cer
- CA_Certificate.cer
- CCA_Certificate.cer
I have to add them to keystore by creating a form chain for the SSL communication.I have followed below steps.
keytool -keystore npci_keystore_test.jks -genkey -alias npci_client_testore
Result :- keystore npci_keystore_test.jks created.
keytool -import -keystore npci_keystore_test.jks -file CA_Certificate.cer -alias theCARoot
Result :- certificate CA_Certificate.cer is added to keystore.
keytool -import -keystore npci_keystore_test.jks -file CCA_Certificate.cer -alias theCCARoot
Result :- certificate CCA_Certificate.cer is added to keystore.
keytool -import -keystore npci_keystore_test.jks -file ABCD.cer -alias npci_client_testore
At the step 4 i have below exception
Enter keystore password: (and when i enter password i have below exception)
keytool error: java.lang.Exception: Public keys in reply and keystore don't match
I have already done search in SO,but so far no luck.
I am following below source to create the store and import certificate in it.
JKS Keystore
EDIT:---
I have tested it by changing the import order of certificate,but no luck so far.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…