1

I have a keystore with an old invalid server certificate that needs to be replaced and I have a file with a certificate chain containing 4 certificates: root, intermediates and server certificate. When I try to import it only the first certificate gets imported. I have tried to import only the server certificate but the application will not pick it up.

How can I import the certificate chain? what alias should I use?

What is the relation with the already existing private key in the keystore?

How can I validate that its working?

command used:

keytool -importcert -file filename.cer -keystore server.jks -alias "url"

keystore entry:

api.tokbox.com-4, Nov 23, 2017, trustedCertEntry, Certificate fingerprint (SHA1): 27:96:BA:E6:3F:18:01:E2:77:26:1B:A0:D7:77:70:02:8F:20:EE:E4 rs-service-dev_cloudservices_XXX_com, Nov 2, 2018, PrivateKeyEntry, Certificate fingerprint (SHA1): 96:B0:CC:7C:D0:F7:4F:88:11:53:43:63:23:76:EE:AA:58:BD:D5:C6 api.tokbox.com-3, Nov 23, 2017, trustedCertEntry, Certificate fingerprint (SHA1): 34:0B:28:80:F4:46:FC:C0:4E:59:ED:33:F5:2B:3D:08:D6:24:29:64 api.tokbox.com-2, Nov 23, 2017, trustedCertEntry, Certificate fingerprint (SHA1): 27:AC:93:69:FA:F2:52:07:BB:26:27:CE:FA:CC:BE:4E:F9:C3:19:B8 api.tokbox.com-1, Nov 23, 2017, trustedCertEntry, Certificate fingerprint (SHA1): 9A:0D:F8:41:26:93:28:F5:02:9F:41:BB:7C:E1:C2:84:21:B4:A9:15

Certificate file:

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
leiyc
  • 903
  • 11
  • 23
Jesper
  • 304
  • 6
  • 10
  • Try to combine those four certificate files into one file. Then use the command to import.:) – leiyc Nov 05 '18 at 07:55
  • 1
    they are already in one file. the problem is that only the first gets read when I run the command. – Jesper Nov 05 '18 at 09:40
  • May be duplicate with https://stackoverflow.com/questions/14660767/keytool-importing-multiple-certificates-in-single-file – leiyc Nov 05 '18 at 09:52

0 Answers0