DevOps 1 min read
NGINX: import a PFX SSL certificate
On this page
This is the easiest way I found of doing that. Note that after the first 2 steps you’ll have to provide the PFX password.
Step 1: Extract CRT file using openssl
#openssl pkcs12 -in your-file-name.pfx -clcerts -nokeys -out domain.name.crt
Step 2: Extract the private key
#openssl pkcs12 -in your-file-name.pfx -nocerts -nodes -out domain.name.rsa
Since this certificate was issued by GoDaddy I also had to get the Intermediate Certificate and chain both certificates. You can download your Intermediat Certificate from GoDaddy Repository
Step 3: Chaining certificates
#cat domain.name.crt gdig2.crt.pem > domain.name.chained.crt
Step 4: Installing the certificate in NGINX
#In your NGINX config file or snippets/snakeoil.conf (depending on many variables) you’ll have to add the following lines:
ssl_certificate /path/to/domain.name.chained.crt
ssl_certificate_key /path/to/domain.name.rsa
That’s it. Restart your NGINX instance and you should be ok.
Got it working, or hit a snag?
Share your setup, a fix or a question. Markdown and code blocks work.
Replying to
How comments and emails are handled: Privacy.