Skip to content

Commit

Permalink
Add PFX generation instructions
Browse files Browse the repository at this point in the history
This should help customers who want to use the PFX/PKCS12 format
  • Loading branch information
phily245 committed Mar 14, 2024
1 parent 850ed42 commit 45a0d23
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
61 changes: 61 additions & 0 deletions source/domains/ssl/generating_pfx_files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# How to Generate a PFX File

```eval_rst
.. title:: SSL | Generating a PFX file
.. meta::
:title: SSL | Generating a PFX file | ANS Documentation
:description: Generating a PFX file
```
This guide will help you generate a PFX (also known as PKCS#12) file on different operating systems.

## Generate a PFX file on Linux

First, check if OpenSSL is installed:

```shell
openssl version
```

If OpenSSL is not installed, you will see an error message. In that case, install OpenSSL:

#### Ubuntu

```shell
sudo apt install openssl
```

#### RHEL/AlmaLinux

```shell
sudo yum install openssl
```

Now you can generate the PFX file.

Suppose you have a private key file (`privateKey.key`), a certificate file (`certificate.crt`), an intermediate certificate file (`intermediate.crt`) and a root certificate file (`root.crt`).
Open a terminal and run the following command:

```shell
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile intermediate.crt -certfile root.crt
```

You’ll be prompted to set an export password to protect the PFX file. Remember this password; you’ll need it later.

## Generate a CSR on Windows

Check if OpenSSL is Installed by opening a Windows Command Prompt and entering:

```powershell
openssl version
```

If OpenSSL is not installed, you will see an error message. In that case, install OpenSSL following the official instructions located at <a href="https://github.com/openssl/openssl/blob/master/README.md" target="_blank">https://github.com/openssl/openssl/blob/master/README.md</a>.

Suppose you have a private key file (`privateKey.key`), a certificate file (`certificate.crt`), an intermediate certificate file (`intermediate.crt`) and a root certificate file (`root.crt`).
Open a terminal and run the following command:

```powershell
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile intermediate.crt -certfile root.crt
```

You’ll be prompted to set an export password. Remember this password for future use.
1 change: 1 addition & 0 deletions source/domains/ssl/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ SSL Certificates
Self Signed Certificates <self_signed_certificates>
Using Server Name Indication (SNI) <sni>
Extended Validation Certificates <extended_validation_ssl>
Generating a PFX file <generating_pfx_files>
letsencrypt/index

0 comments on commit 45a0d23

Please sign in to comment.