- 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/.
- Open a command prompt or terminal window and navigate to the directory where your SSL certificate files are located.
- Run the following command to convert the .cer file to .pem format:csharp
openssl x509 -inform der -in yourdomain.cer -out yourdomain.pem
- Run the following command to convert the private key file to .pem format:csharp
openssl rsa -in yourdomain.key -out yourdomainkey.pem
- 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 - You will be prompted to enter a password for the .pfx file. Enter a secure password and confirm it.
- 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.