Raffaeu
Raffaeu

Reputation: 6973

Import .pfx Certificate with Keytool is not working

Right now I am securing my installation of ElasticSearch using SSL. In the guide they mention to secure the endpoint by importing an x.509 certificate using the following keytool command:

keytool -importcert -keystore node01.jks -file cacert.pem -alias my_ca

The problem is that I have a .pfx file generated by a CA authority. If I pass the .pfx file keytool bombs saying

Input not an X.509 certificate.

How can I fix this, is there a way to convert the .pfx into a .pem certificate?

Upvotes: 1

Views: 4799

Answers (1)

Val
Val

Reputation: 217274

You can do so easily using the following command:

openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes

You can also name the output certificate certificate.pem if you wish. PEM certificates can usually have any of the following extentions: .pem, .crt, .cer, and .key

Upvotes: 1

Related Questions