Convert PFX SSL Certificate
Mcrosoft Azure App Certificate is used to secure Azure App Services, now they allow export of this SSL certificate in PFX format, so it can be used in other services like Azure VM or third party applications. You need to use a powershell script provided by Microsoft to do the Export.
To use the SSL certficiate in FPX format in Apache or Nginx web server, you need to convert it.
To do this, run
openssl pkcs12 -in ssl.pfx -nocerts -out key.pem
It will ask for Import password. If you enter a password during pfx file creation, enter it. If not just press enter.
Next it ask for PEM password, enter a password, with out password, it won’t work.
We have key.pem, that is password protected, we need to remove key file with out password, for this, run
openssl rsa -in key.pem -out key-no-pw.key
To export certificate file from PFX file, run
openssl pkcs12 -in ssl.pfx -clcerts -nokeys -out cert.pem