Convert Certificate from .CER to .PFX for use in Azure

This article will guide on how to convert certificate to .pfx format which is normally used in Azure to secure resources. Certificate purchased for use is most of the times not in the corect format required by servers so there is need for conversion. Follow the steps below to have your certificate converted from .cer to .pfx .

Download openSSL from slproweb.com/products/Win32OpenSSL.html

Install into root of C:\ and follow all steps from installation link above

image.png

Open CMD as an administrator and enter drive C:\

Create a folder called Certificate and cd into it.

Set environment variables for the openSSL using the following commands

set RANDFILE=C:\Certificate\.md

set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg

image.png

Open openSSL with this command -
C:\OpenSSL-Win64\bin\openssl.exe

image.png

Issue the following command which will generate a .key version of your certificate

req -new -newkey rsa:2048 -nodes -out mybucket.csr -keyout mybucket.key

The next line of action will be to generate the .pfx of the certificate. Enter the following command in the C:\Certificate

pkcs12 -export -out <certificate.pfx> -inkey <privateKey.key> -in <certificate.crt>

certificate.pfx> => is the name of the new .pfx to be generated

privateKey.key> => is the name of the previously generated private key in your C:\Certificate folder

certificate.crt> => is the new rekeyed certificate gotten from go daddy

Once the .pfx is generated you can then attach it to your Azure instance.

I hope this helps you in generating a pfx versioned certificate for your use in Azure.