Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert a crt + p7b (from godaddy) to pfx
echo off
:: download OpenSSL if you don't have it for the below
:: Conver the p7b into PEM format
openssl pkcs7 -in mydomain.p7b -print_certs -out mydomain.pem
:: Combine this with the crt server certificate and private key into a PFX
openssl pkcs12 -export -in mydomain.crt -inkey mydomain.key -certfile mydomain.pem -out mydomain.pfx
@Fenici

This comment has been minimized.

Copy link

Fenici commented Dec 20, 2017

hi Andrew where is this -inkey mydomain.key come from ?

@SBYGIS

This comment has been minimized.

Copy link

SBYGIS commented Jan 23, 2018

The current directory you are working in. You can also specify a path like ./path/to/mydomain.crt.

@Nomenator

This comment has been minimized.

Copy link

Nomenator commented Jun 14, 2018

The .key file should be obtainable from the certificate request which you have created for Godaddy.

For that, you will need a Windows Server with IIS installed on it, go to Server Management, select "Internet Information Services" from Tools, and create a certificate request. Then, in Microsoft Management Console you will be able to see this request among the certificates, in the "Certificate Enrolment Requests" group. (How to generate certificate request and export private key)

When you're done with all of this, you will have a certificate request which you can provide to Godaddy to generate your certificate and a private key file which will match this certificate. The key will likely be in .pfx format, and you'll need to convert it into .pem or .key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.