nikel nikel - 1 year ago 190
Java Question

Error Importing SSL certificate : Not an X.509 Certificate

I am trying to Update the SSL certificate in accordance with this post

I am noob in certificates, so i followed this guide. But, when i enter

keytool -keystore mycacerts -storepass changeit -importcert -file "C:\Users\Noks\Desktop\cacerts.pem" -v

I get the error:

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

How do i fix this?

Answer Source

Does your cacerts.pem file hold a single certificate? Since it is a PEM, have a look at it, it should start with


and end with


Finally, to check it is not corrupted, get hold of openssl and print its details using

openssl x509 -in cacerts.pem -text

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download