How to merge PFX certificate using OpenSSL

Object

PFX is the filename extension of PKCS#12 format that stores many cryptography objects, you can imagine it as a “zip” or “tar.gz” file that contains the private key, actual certificate, trust root CA certificate. It is commonly used by Windows, Linux, and security devices such as firewalls, load balancers. This post will show you how to find the private key in Godaddy CPanel, then use OpenSSL to merge PFX certificates

Solution

In this example the certificate request is generated from CPanel originally, hence we need to find the private key from there, we already got the actual certificate from our provider Godaddy.

  • Log into your CPanel and look for “File Manager” then folder “SSL” then “keys”, the “.key” is the actual private key.
cpanel-file-manager-private-key
Path to find the private key in CPanel File Manager, this example is from Godaddy Web Hosting
  • Download the certificate file from Godaddy portal and you will see some thing like below

Please be aware:

  1. gd_bundle-g2-g1.crt is the Trust Root CA Cert for Godaddy, normally you can find it in your computer Trust Root CA store as well via mmc.exe
  2. 99…4b.crt and 99…4b.pem is the actual certificate with different format
  • Download and install the OpenSSL from https://slproweb.com/products/Win32OpenSSL.html or install via Git repository https://github.com/openssl/openssl
  • Finally, “Zip” your certificates, private key into a PFX file

C:\Program Files\OpenSSL-Win64\bin>openssl.exe pkcs12 -export -out ICTFella.pfx -inkey private.key -in servercert.crt -certfile gd_bundle-g2-g1.crt

Enter Export Password:
Verifying – Enter Export Password:

Useful links

https://www.sysadmins.lv/blog-en/how-to-join-certificate-and-private-key-to-a-pkcs12pfx-file.aspx

  • openssl-pkcs12

https://www.openssl.org/docs/man3.0/man1/openssl-pkcs12.html

2 thoughts on “How to merge PFX certificate using OpenSSL”

  1. I seriously love your blog.. Excellent colors & theme. Did you create this site yourself? Please reply back as I’m attempting to create my own blog and want to know where you got this from or what the theme is called. Kudos!

Leave a Reply to Fella Cancel Reply

Your email address will not be published. Required fields are marked *