When I try to import ssl cert to Java KeyStore I get an error:

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

I used the OpenSSL to generate a CSR file and to export CRT and key to PFX file.

To generate the CSR file I used the command:

openssl req -new -sha256 -out \  
domain.name.csr -newkey rsa:2048 -keyout \  
domain.name.key -config <( cat csr_details.txt )

To create a certificate I used the command:

openssl pkcs12 -export -out domain.name.pfx -inkey domain.name.key -in domain.name.crt
  • How did you create the file domain.name.crt? – Mark Thomas Aug 2 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.