Post

SSL conversion of .pfx to .pem format

How to convert a Windows SSL certificate from .pfx format to .pem format for use with AWS services using OpenSSL.

When working with AWS Certificate Manager to import certificates into load balancers or CloudFront distributions, you’ll often need to convert from Windows’ native .pfx format to the .pem format that AWS requires.

The .pfx (Personal Information Exchange) format is used by Windows to export SSL certificates along with their private keys, allowing migration between machines. AWS services, however, expect .pem format.

Conversion Command

The conversion can be done in a single OpenSSL command:

openssl pkcs12 -in src-ssl.pfx -out dest-ssl.pem -nodes

You’ll be prompted to enter the password for the .pfx file. The resulting .pem file will contain three sections:

  1. Private Key — the certificate’s private key
  2. Certificate — the SSL certificate itself
  3. Certificate Chain — the intermediate and root authority certificates

These sections can be extracted individually if needed, for example when AWS Certificate Manager asks for the certificate body, private key, and certificate chain as separate inputs.

← Back to all posts