Recently I had to setup hMailServer to work with SSL. You know, sending and retrieving email in a secure fashion is a good idea. To use SSL in hMailServer, you have to provide it with a public certificate and a private key. I was supplied a PFX file so I had to extract the public cert and the private key from it. This is quite a common task by the way. To accomplish this, you will need OpenSSL. It is available freely. So, first download it. Once you have the OpenSSL installed, follow these four easy steps:
Step 1. Extract the private key from the PFX file.
Step 2. Remove password protection from the private key extracted in Step 1. We use the same file name, so, basically we are overwriting the private key file.
Step 3. Convert the pfx file to a .pem file. This step can be done by several online tools but we are cooler, so we do this with OpenSSL again.
Step 4. This is the final step. We extract the public key from the full.pem file that we created in step 3.
Hope this short posts helps you with your SSL conversions. Keep a couple of points in mind:
1. OpenSSL is available for 32 bit and 64 bit versions of Windows and make sure to download correct one.
2. You will need Visual C++ 2008 binaries and without them OpenSSL will not work. The OpenSSL installer will ask about it if it does not find on your machine.
3. You will need the PFX cert password. Make sure to have it at hand.
4. If you do not have OpenSSL bin folder in your environment variables, the commands will not work directly in the command prompt. The easiest thing you could do is to copy your .pfx file to the OpenSSL's bin folder.
Step 1. Extract the private key from the PFX file.
openssl pkcs12 -in your_cert_file_name.pfx -nocerts -out private.pem Step 2. Remove password protection from the private key extracted in Step 1. We use the same file name, so, basically we are overwriting the private key file.
openssl rsa -in private.pem -out private.pem Step 3. Convert the pfx file to a .pem file. This step can be done by several online tools but we are cooler, so we do this with OpenSSL again.
openssl pkcs12 -in your_cert_file.pfx -out full.pem Step 4. This is the final step. We extract the public key from the full.pem file that we created in step 3.
openssl x509 -inform pem -in full.pem -pubkey -out public.pem -outform pem Hope this short posts helps you with your SSL conversions. Keep a couple of points in mind:
1. OpenSSL is available for 32 bit and 64 bit versions of Windows and make sure to download correct one.
2. You will need Visual C++ 2008 binaries and without them OpenSSL will not work. The OpenSSL installer will ask about it if it does not find on your machine.
3. You will need the PFX cert password. Make sure to have it at hand.
4. If you do not have OpenSSL bin folder in your environment variables, the commands will not work directly in the command prompt. The easiest thing you could do is to copy your .pfx file to the OpenSSL's bin folder.
7:54 AM
iTinkerer






