SSL Certificate - Keytool Exception

I’m following this guide:

Got the .p7b file from, moved it into my droplet, then ran:

keytool -import -trustcacerts -alias server -file placeholder.p7b -keystore placeholder.jks

But it’s throwing:

keytool error: java.lang.Exception: Input not an X.509 certificate

I followed by running:

openssl x509 -in placeholder.p7b -text

And got:

unable to load certificate
140089256595904:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE

Does that mean my certificate is corrupted somehow? (I didn’t even touch it, just downloaded it)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Adding to this, I have the following download options, but the guide said to pick .p7b

  1. Individual .crts (zipped)
  2. A P7B bundle of all the certs in a .p7b file
  3. A P7B bundle of all the certs with a .cer extension
  4. Separate primary and intermediate .crt files (zipped)
  5. A single .pem file containing all the certs
  6. A single .pem file containing only the end entity certificate
  7. A single .pem file containing all the certs except for the root
  8. Individual .crt files with a .cer extension (zipped)
  9. Individual .crt files with a .pem extension (zipped)