Thursday, 10 October 2024
How To's

How to convert an SSL certificate from .cer to .pfx format with Openssl

  1. First, make sure you have OpenSSL installed on your system. If you don’t have it installed, you can download it from https://www.openssl.org/.
  2. Open a command prompt or terminal window and navigate to the directory where your SSL certificate files are located.
  3. Run the following command to convert the .cer file to .pem format:csharp
    openssl x509 -inform der -in yourdomain.cer -out yourdomain.pem
  4. Run the following command to convert the private key file to .pem format:csharp
    openssl rsa -in yourdomain.key -out yourdomainkey.pem
  5. Finally, run the following command to convert the .pem files to .pfx format: objective
    openssl pkcs12 -export -out yourdomain.pfx -inkey yourdomainkey.pem -in yourdomain.pem
  6. You will be prompted to enter a password for the .pfx file. Enter a secure password and confirm it.
  7. The resulting .pfx file will be created in the same directory as your SSL certificate files.

That’s it! You now have a .pfx file that contains both your SSL certificate and private key, which you can use to install the SSL certificate on your server.

Post Comment