Learn how to Convert SSL Certificate to PFX (PEM/CRT to PFX)
There are many situations where you might need to convert PEM SSL Certificates (mainly due to Linux Environments like Certbot or Cloudflare etc.) but you need to Import the PFX certificate in Microsoft Platforms like IIS or Azure. Below are the Steps which can help you to convert this certificate.
Prerequisites:
- Download OpenSSL from Here
- Keep ready the certificate SSL files i.e. crt.pem and pvt.key which was obtained from Linux or Cloudflare etc platform
- Install Open SSL (usually installed in C:\Program Files\OpenSSL-Win64\)
Steps to Convert PEM SSL Certificate to PFX
- Open Command Prompt as Administrator (right-click on Command Prompt and select Run as Administrator)
- Switch to OpenSSL path i.e. C:\Program Files\OpenSSL-Win64\
- Verify that the Command Prompt path should be like below
4. Copy the SSL certificate files for ex:- certificate_pvt.key and certificate.pem into the bin folder (else you can mention the absolute path of these files)
5. After copying the SSL files into the Bin folder. Run the below command in the command prompt.
openssl pkcs12 -inkey certificate_pvt.key -in certificate.pem -export -out certificate.pfx
6. It will prompt you to enter the pfx file password twice. Please enter your desired password and press enter. If no error occurs then the file has been exported out to pfx certificate.
Look for the certificate.pfx file in C:\Program Files\OpenSSL-Win64\Bin. Copy it and Import it to Windows Server, Azure, or wherever you may need to.
Also know How to Convert PFX to Crt/PEM & Key Files in 3 Easy Steps
Conclusion
It is simple to get the PFX certificate from CRT/PEM and key files. It can be done through an online portal like SSL shopper. However, I would not suggest it as your own certificate would be uploaded on the third-party server which could be the compliance issue. Rather go for the Offline conversion as mentioned above. If you like this article you can share it further.
- Entra ID (Azure Active Directory): Migration and Integration Guide - 20 December 2024
- Active Directory Federation Services (ADFS): Implementation Guide - 16 December 2024
- Active Directory Backup and Recovery Strategy: Comprehensive Guide - 11 December 2024