Skip to content

Instantly share code, notes, and snippets.

@mzubairsaleem
Forked from novemberborn/howto.md
Created August 12, 2020 23:00
Show Gist options
  • Save mzubairsaleem/06c5858c0d911b487cbe89b8912dc129 to your computer and use it in GitHub Desktop.
Save mzubairsaleem/06c5858c0d911b487cbe89b8912dc129 to your computer and use it in GitHub Desktop.
Creating a PKCS#12 file from a Let's Encrypt certificate

Assuming you received the certificate in DER form, saved to cert.der:

openssl x509 -inform der -in cert.der -out chain.pem

Append the content of https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.pem.txt to chain.pem.

Save https://letsencrypt.org/certs/letsencryptauthorityx1.pem.

Assuming the private key for the certificate is in privkey.pem:

openssl pkcs12 -export -inkey privkey.pem -in chain.pem -CAfile letsencryptauthorityx1.pem -out cert.p12

cert.p12 now includes the private key, your certificate, and the full certificate chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment