DevOps 1 min read

NGINX: import a PFX SSL certificate

Photo · Stephen Phillips - Hostreviews.co.uk on Unsplash
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

#
shell
openssl pkcs12 -in your-file-name.pfx -clcerts -nokeys -out domain.name.crt

Step 2: Extract the private key

#
shell
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

#
shell
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:

shell
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.

Share Suggest an edit

Suggest an edit

NGINX: import a PFX SSL certificate

Your suggestion and any name or email you give are stored and emailed to the author. Privacy

Read it in your terminal
curl -sL florea.xyz/nginx-import-a-pfx-ssl-certificate.md
View as Markdown
NORMAL nginx-import-a-pfx-ssl-certificate.md [devops] utf-8 · unix · 1 min read Top
Discussion · 0

Got it working, or hit a snag?

Share your setup, a fix or a question. Markdown and code blocks work.

How comments and emails are handled: Privacy.