Please follow the below steps to convert a PEM certificate to PFX.
2. Open the command prompt and change the directory to OpenSSL
Once you are in the OpenSSL folder, please execute the below command. This is to convert the PEM file to the key file. Make sure you are giving correct certificate paths.
openssl rsa -in E:\certificate\mycertificate.pem -out E:\certificate\private.key
It will ask for the passphrase, please type it and hit enter. Once it is successful you can see the below message.
3. Once you have the key file then you can convert the PEM to PFX using the below command,
openssl pkcs12 -export -out E:\certificate\mycertificate.pfx -inkey E:\certificate\private.key -in E:\certificate\mycertificate.pem -certfile E:\certificate\mycertificate.pem
#privatekey – Which we have created in step2
#pfx – output format
#pem – source format
Hit enter and it will ask you to provide an export password. Please note this password somewhere for future reference.
Confirm the password
Once confirmed you can see the pfx file in the output path.
- Open IIS
- Open Server Certificates
- Click on import
- Enter the password which you have given in step 3
- Once imported you can see the certificate in IIS.
- Go to default web site-> Bindings
- Choose Type, the SSL certificate and enter the host name.
- Click on OK
Now the server will be reachable with HTTPS