8th
May
2025
How to Extract SSL Certificates from a PFX File on macOS
If you’ve ever been handed a .pfx file and told to “just upload the certificate,” you know the pain that’s coming.
PFX (PKCS#12) files bundle your private key, SSL certificate, and any intermediate certificates into one encrypted file. That’s great until you actually need to extract those pieces for something like an NGINX server, AWS load balancer, or third-party CDN that wants them all separately.
MacOS has OpenSSL built in, which is all you need. Here’s a simple shell script I use to generate the cert, private key, and chain in one shot and make them clipboard-ready for easy pasting.