Skip to content

Instantly share code, notes, and snippets.

@damaya
Created August 18, 2017 22:30
Show Gist options
  • Select an option

  • Save damaya/681fcc8819e919585208d04b522431b6 to your computer and use it in GitHub Desktop.

Select an option

Save damaya/681fcc8819e919585208d04b522431b6 to your computer and use it in GitHub Desktop.
Procedure
Take the file you exported (e.g. certname.pfx) and copy it to a system where you have OpenSSL installed. Note: the *.pfx file is in PKCS#12 format and includes both the certificate and the private key.
Run the following command to export the private key: openssl pkcs12 -in certname.pfx -nocerts -out key.pem -nodes
Run the following command to export the certificate: openssl pkcs12 -in certname.pfx -nokeys -out cert.pem
Run the following command to remove the passphrase from the private key: openssl rsa -in key.pem -out server.key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment