> ## Documentation Index
> Fetch the complete documentation index at: https://docs.futurex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure TLS certificates for mutual authentication

> Instructions for generating and configuring X.509 TLS certificates to enable mutual authentication between Vault and KMES Series 3.

Before secure connections between HashiCorp Vault and the KMES Series 3 can occur, both parties must establish a mutual trust relationship by validating their respective digitally signed certificates. This section describes how to create X.509 certificates for HashiCorp Vault and the Vault Client connection pair on the KMES Series 3, necessary for TLS communication.

You can use the following optional methods to create the HashiCorp Vault and Vault Client connection pair TLS certificates:

* Use an external CA
* Use the KMES Series 3 as the CA

## Use an External CA

To use an external CA, you must complete the following tasks:

1. Create a TLS certificate for Vault.
2. Import the certificate and chain to the KMES Series 3.
3. Create a TLS certificate for the Vault connection pair on the KMES Series 3.

The following sections show you how to perform these tasks:

### Create a TLS certificate for HashiCorp Vault

Perform the following steps to create a TLS certificate for HashiCorp Vault:

> [!NOTE]
>
> The HashiCorp Vault client certificate must use the V3 extension TLS Server Authentication.

**Step 1**

Generate a private key by running the following OpenSSL command in a terminal:

```shell expandable lines wrap title="Shell" theme={null}
openssl genrsa -out client-privatekey.pem 2048
```

**Step 2**

Generate a Certificate Signing Request (CSR) by running the following OpenSSL command:

```shell expandable lines wrap title="Shell" theme={null}
openssl req -new -key client-privatekey.pem -out client-cert-req.pem -days 365
```

Specify the IP address or hostname of the HashiCorp Vault server as the **Common Name** in the CSR.

**Step 3**

Get an External CA to sign the CSR by sending the CSR file to the external CA.

**Step 4**

After the CSR is signed, download the signed certificate and the chain of CA certificates used to sign it.

### Import the signed certificate and chain

Perform the following steps to import the signed HashiCorp Vault certificate and chain into a new X.509 certificate container on the KMES Series 3:

**Step 1**

Log in to the KMES Series 3 application interface with the default Admin identities.

**Step 2**

Go to **PKI**> **Certificate Authorities** and select **\[ Add CA ]**.

**Step 3**

Specify a name for the X.509 certificate container and select **\[ OK ]**.

**Step 4**

Right-click the new certificate container and select **Import**> **Certificate(s)**.

**Step 5**

In the **Import Certificates** window, select **\[ Add ]**.

**Step 6**

Select the signed HashiCorp Vault certificate and all CA certificates in the certificate chain, and select **\[ Open ]**.

> [!TIP]
>
> All certificates should display in a tree form in the Verified section of the Import Certificates window.

**Step 7**

Select **\[ OK ]** to save.

### Create a TLS certificate for the Vault Client connection pair

To create the TLS certificate for the Vault client connection pair on KMES Series 3, complete the following tasks:

1. Generate a private key and CSR for the connection pair.
2. Get the external CA to sign the CSR.
3. Configure the connection pair to use the signed CSR.

The following sections show you how to perform these tasks:

#### Generate a private key and CSR

Perform the following steps to generate a private key and construct a CSR for the Vault client connection pair:

**Step 1**

Log in to the KMES Series 3 application interface with the default Admin identities.

**Step 2**

Go to **Administration**> **Configuration**> **Network Options**. On the **TLS/SSL Settings** tab, select the **Vault Client** connection pair from the **Connection** drop-down menu.

**Step 3**

Enable the Vault client connection pair if it is not already enabled.

**Step 4**

Uncheck **Use System/Host API SSL Parameters** if it is selected.

**Step 5**

In the **User Certificates** section, select **\[ Edit ]** next to **PKI Keys**.

**Step 6**

In the **Application Public Keys** window, select **\[ Generate ]**.

**Step 7**

When warned that *SSL will not be functional until new certificates are installed*, select **\[ Yes ]** to continue.

**Step 8**

In the **PKI Parameters** window, leave all fields set to the default values and select **\[ OK ]**.

> [!TIP]
>
> It now displays Loaded in the Application Public Keys window.

**Step 9**

In the **Application Public Keys** window, select **\[ Request ]**.

**Step 10**

On the **Subject DN** tab, change the **Preset** drop-down option to **Classic** and specify the **IP address** or **Hostname** of the KMES in the **Common Name** field.

**Step 11**

On the **V3 Extensions** tab, set the profile to **TLS Client Certificate**.

**Step 12**

On the **PKCS #10** information tab, specify a save location and name for the CSR file, and select **\[ OK ]**.

**Step 13**

When prompted that the certificate signing request was successfully written to the specified location, select **\[ OK ]**.

**Step 14**

Select **\[ OK ]** again to save the **Application Public Keys** settings.

#### Get an external CA to sign the CSR

Take the CSR file to the external CA. After the CSR is signed, download the signed certificate and the chain of CA certificates used to sign it.

#### Configure the connection pair

Perform the following steps to configure the Vault client connection pair to use the signed certificate and CA chain:

**Step 1**

Log in to the KMES Series 3 application interface with the default Admin identities.

**Step 2**

Go to **Administration**> **Configuration**> **Network Options**. On the **TLS/SSL settings** tab, select **Vault Client** from the **Connection** drop-down menu.

**Step 3**

In the **User Certificates** section, select **\[ Edit ]** next to **Certificates**.

**Step 4**

In the **Certificate Authority** window, right-click on the **Vault Client SSL CA** X.509 certificate container, and select **\[ Import ]**.

**Step 5**

In the **Import Certificates** window, select **\[ Add ]**.

**Step 6**

In the file browser, select both the root CA certificate and the signed Vault Client connection pair certificate, and select **\[ Open ]**.

> [!TIP]
>
> The certificates should now display in the Verified section of the Import Certificates window.

**Step 7**

Select **\[ OK ]**.

> [!TIP]
>
> It now says Signed Loaded next to Certificates in the User Certificates section.

**Step 8**

Select **\[ OK ]** to save.

## Use the KMES Series 3 as the CA

To use the KMES as the CA, you must complete the following tasks:

1. Create the CA.
2. Create a TLS certificate for the Vault.
3. Create and configure the TLS certificate for the Vault client connection pair.

The following sections show you how to perform these tasks:

### Create the CA

**Step 1**

Log in to the KMES Series 3 application interface with the default Admin users.

**Step 2**

Go to **PKI**> **Certificate Authorities** and select **\[ Add CA ]**.

**Step 3**

Specify a name for the CA and select **\[ OK ]**.

> [!TIP]
>
> The new certificate container now displays in the Certificate Authorities window.

**Step 4**

Right-click the new certificate container and select **Add Certificate**> **New Certificate**.

**Step 5**

Change the **Preset** drop-down option to **Classic** and set the **Common Name** value to `Root`.

**Step 6**

On the **Basic Info** tab, leave all fields set to the default values.

**Step 7**

On the **V3 Extensions** tab, set the **Profile** to **Certificate Authority** and select **\[ OK ]**.

> [!TIP]
>
> The Root certificate now displays under the certificate container you created.

### Create the TLS certificate for HashiCorp Vault

To create the TLS certificate, you must perform the following steps:

1. Generate a private key and CSR.
2. Sign the CSR.

The following sections show you how to perform these tasks:

#### Generate a private key and CSR

Perform the following steps to generate a private key and construct a CSR for HashiCorp Vault:

**Step 1**

In a terminal, run the following OpenSSL command to generate a private key.

```shell expandable lines wrap title="Shell" theme={null}
openssl genrsa -out client-privatekey.pem 2048
```

**Step 2**

In a terminal, run the following OpenSSL command to generate a CSR, specifying the IP address or hostname of the HashiCorp Vault server as the **Common Name**:

```shell expandable lines wrap title="Shell" theme={null}
openssl req -new -key client-privatekey.pem -out client-cert-req.pem -days 365
```

#### Sign the CSR

Perform the following steps to sign the HashiCorp Vault CSR:

**Step 1**

Go to **PKI**> **Certificate Authorities**.

**Step 2**

Right-click the Root CA certificate you created and select **Add Certificate**> **From Request**.

**Step 3**

In the file browser, select the HashiCorp Vault CSR.

> [!TIP]
>
> Certificate information populates in the Create X.509 From CSR window.

**Step 4**

On the **V3 Extensions** tab, set the profile to **TLS Server Certificate** and select **\[ OK ]** to save.

> [!TIP]
>
> The signed HashiCorp Vault certificate displays now under the Root CA certificate in the CA tree.

### Create and configure the TLS certificate

To create and configure the TLS certificate for the Vault client connection pair on the KMES Series 3, complete the following tasks:

1. Generate a private key and construct a CSR.
2. Sign the CSR.
3. Export the certificates in the CA tree and add them to the Vault client connection pair.

The following sections show you how to perform these tasks:

#### Generate a private key and CSR

Perform the following steps to generate a private key and construct a CSR for the Vault Client connection pair:

**Step 1**

Log in to the KMES Series 3 application interface with the default Admin identities.

**Step 2**

Go to **Administration**> **Configuration**> **Network Options**. On the **TLS/SSL Settings** tab, select the **Vault Client** connection pair from the **Connection** drop-down menu.

**Step 3**

Enable the Vault Client connection pair if it is not already enabled.

**Step 4**

Uncheck **Use System/Host API SSL Parameters** if it is selected.

**Step 5**

In the **User Certificates** section, select **\[ Edit ]** next to **PKI Keys**.

**Step 6**

In the **Application Public Keys** window, select **\[ Generate ]**.

**Step 7**

When warned that *SSL will not be functional until new certificates are installed*, select **\[ Yes ]** to continue.

**Step 8**

In the **PKI Parameters** window, leave all fields set to the default values and select **\[ OK ]**.

> [!TIP]
>
> It now says Loaded in the Application Public Keys window.

**Step 9**

In the **Application Public Keys** window, select **\[ Request ]**.

**Step 10**

On the **Subject DN** tab, change the **Preset** drop-down option to **Classic** and specify the **IP address** or **Hostname** of the KMES in the **Common Name** field.

**Step 11**

On the **V3 Extensions** tab, set the profile to **TLS Client Certificate**.

**Step 12**

On the **PKCS #10 Info** tab, specify a save location and name for the CSR file and select **\[ OK ]**.

**Step 13**

When prompted that *the certificate signing request was successfully written to the specified location*, select **\[ OK ]**.

**Step 14**

Select **\[ OK ]** again to save the **Application Public Keys** settings.

#### Sign the CSR

Perform the following steps to sign the Vault client connection pair CSR:

**Step 1**

Go to **PKI**> **Certificate Authorities**.

**Step 2**

Right-click the Root CA certificate you created and select **Add Certificate**> **From Request**.

**Step 3**

In the file browser, select the Vault Client connection pair CSR.

> [!TIP]
>
> Certificate information populates in the Create X.509 From CSR window.

**Step 4**

Leave all settings set to the defaults and select **\[ OK ]** to save.

> [!TIP]
>
> The signed Vault Client connection pair certificate now displays under the Root CA certificate in the CA tree.

#### Export all certificates and import them

To export the certificates, right-click each certificate in the certificate tree and select **Export**> **Certificate(s)**. In the **Export Certificate** dialog for each of them, change the encoding to **PEM**, and specify a save location for the file.

Then, perform the following instructions to import them to the Vault client connection pair:

**Step 1**

Log in to KMES Series 3 application interface with the default Admin identities.

**Step 2**

Go to **Administration**> **Configuration**> **Network Options**. Under the **TLS/SSL settings** tab, select **Vault Client** from the **Connection** drop-down menu.

**Step 3**

In the **User Certificates** section, select **\[ Edit ]** next to **Certificates**.

**Step 4**

In the **Certificate Authority** window, right-click on the **Vault Client SSL CA** X.509 certificate container and select **\[ Import ]**.

**Step 5**

In the **Import Certificates** window, select **\[ Add ]**.

**Step 6**

In the file browser, select both the root CA certificate and the signed Vault Client connection pair certificate, and select **\[ Open ]**.

> [!TIP]
>
> The certificates should now display in the Verified section of the Import Certificates window.

**Step 7**

Select **\[ OK ]**.

> [!TIP]
>
> It now says Signed Loaded next to Certificates in the User Certificates section.

**Step 8**

Select **\[ OK ]** to save.
