Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have been struggling since last night to create a .pfx file using OpenSSL. I have been following this document and have been following the instructions under the Get a certificate using OpenSSL header.

I have also tried various things from trawling through posts but my lack of experience in this area is really impeding my efforts.

I am at the step here: openssl pkcs12 -export -out myserver.pfx -inkey myserver.key -in myserver.crt and am using the OpenSSL.exe console.

I get the error: unable to load certificates

I am using IIS 7 and purchased a certificate from Symantec. I think my problem is that my certificate starts like:

----BEGIN PKCS #7 SIGNED DATA----- and not simply -----BEGIN CERTIFICATE----- so the command in my walk-through is not able to deal with it.

Is this a .pb7 certificate?

I have a .key file and a .crt file. How do I create a .pfx files with the above formats?

share|improve this question
Could you show the whole error? Are you using relative path in the command? – ALex_hha Mar 26 '14 at 10:35
I will later, I'm not at that PC at the moment but will later. The files are located in C:\temp\myserver.key or C:\temp\myserver.crt on a laptop running Windows 7 and IIS 7. The command has those paths referenced. – davy Mar 26 '14 at 10:39

1 Answer 1

up vote 1 down vote accepted

To extract the certificate from the PKCS#7 container that you appear to have, run

openssl pkcs7 -in cert.p7b -print_certs -out cert.cer

Than you can use the pkcs12 command you already stated in the question to generate the PKCS#12 (pfx) container.

share|improve this answer
thank you. I will try this evening. So I eould rename my .crt to .pb7? How do I then get that .cer to a .pfx? – davy Mar 26 '14 at 13:41
You don't have to rename it, you can use whatever name it has right now. I just used that extension for clarification which file format I mean. As for the pfx-conversion, I appended my answer above – mat Mar 26 '14 at 15:37
thanks again, will let you know. – davy Mar 26 '14 at 16:03
thanks, this worked perfectly. – davy Mar 26 '14 at 20:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.