openssl command to convert .crt to .pem fails: unable to load certificates

Latest response

Have created a .crt on a RHEL8 Server with the following command:

openssl req -newkey rsa:2048 -nodes -keyout foo.key -out certificate.crt

I'm able to verify ok the .crt file with another openssl command with no issues:

openssl req -text -noout -verify -in certificate.crt 

We are trying to convert the .crt to .pem because the CA is a Windows 2016 Server with the CA role installed, in order to have the cert signed. This Windows Server is hosted internal in the current company that I work in as well.

When I try to convert with the following command, I get the following error: unable to load certificates:

openssl pkcs12 -export -in certificate.crt -inkey privatekey.key -out certificate.pfx

Responses