> ## 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 between MySQL Server and the KMES Series 3

> Detailed procedure to generate and configure X.509 certificates for TLS mutual authentication between MySQL and KMES.

Before KMIP connections between MySQL Server and the KMES Series 3 can occur, both parties must establish a mutual trust relationship by validating their respective digitally signed certificates. This section shows you how to create X.509 certificates for MySQL Server and the KMIP connection pair on the KMES Series 3, which they use for TLS communication.

## Create the X.509 certificates for TLS mutual authentication

Use one of the following optional methods for creating the MySQL Server and KMIP connection pair TLS certificates:

1. Use an external CA
2. Use the KMES Series 3 as the CA

## Method 1: Use an external CA

To use an external CA to create the TLS certificates, perform the following tasks:

1. Generate a private key pair and create a Certificate Signing Request (CSR) for MySQL Server.
2. Create a TLS certificate for the KMIP connection pair on the KMES Series 3.

### Generate a private key and  CSR

Perform the following tasks in this section to create the private key and CSR for MySQL Server:

1. Generate a private key.
2. Get the CSR signed.
3. Import the certificate and chain onto the KMES Series 3.

#### Generate a private key

Perform the following steps to generate a private key:

<Steps>
  <Step>
    In a terminal, run the following OpenSSL command to generate a private key:

    ```shell expandable lines wrap title="Shell" theme={null}
    openssl genpkey -algorithm RSA -out key.pem
    ```
  </Step>

  <Step>
    Run the following OpenSSL command to generate a CSR, specifying `MySQL` as the **Common** **Name** in the CSR.:

    ```shell expandable lines wrap title="Shell" theme={null}
    openssl req -new -key key.pem -out client.csr
    ```
  </Step>
</Steps>

#### Get the CSR signed

Perform the following steps to get the CSR signed by an external CA:

<Steps>
  <Step>
    Send the CSR file to the external CA.
  </Step>

  <Step>
    After the CSR is signed, download the signed certificate and the chain of CA certificates that were used to sign it.
  </Step>
</Steps>

#### Import the certificate

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

<Steps>
  <Step>
    Log in to the KMES Series 3 application interface with the default Admin identities.
  </Step>

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

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

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

  <Step>
    In the **Import** **Certificates** window, select **\[ Add ]**.
  </Step>

  <Step>
    Select the signed MySQL Server certificate and all CA certificates in the certificate chain, and select **\[ Open ]**.

    <Check>
      All of the certificates display in tree form in the Verified section of the Import Certificates window.
    </Check>
  </Step>

  <Step>
    Select **\[ OK ]** to save.
  </Step>
</Steps>

### Create a TLS certificate for the KMIP connection pair on the KMES Series 3

To create the TLS certificate, perform the following tasks:

1. Generate a private key and create a CSR.
2. Get the CSR signed.
3. Configure a KMIP connection pair.

#### Generate a private key and CSR

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

<Steps>
  <Step>
    Log in to the KMES Series 3 application interface with the default Admin identities.
  </Step>

  <Step>
    Go to **Administration** > **Configuration** > **Network** **Options** and go to the **TLS/SSL Settings** tab.
  </Step>

  <Step>
    Select the **Connection** drop-down option and select the **KMIP** connection pair.
  </Step>

  <Step>
    **Enable** the KMIP connection pair if it is not already enabled.
  </Step>

  <Step>
    Uncheck the **Use System/Host API SSL Parameters** checkbox if it is selected.
  </Step>

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

  <Step>
    In the **Application Public Keys** window, select **\[ Generate ]**.
  </Step>

  <Step>
    When prompted that *SSL will not be functional until new certificates are imported*, select **\[ Yes ]** to continue.
  </Step>

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

    <Check>
      The Application Public Keys window now shows that a PKI Key Pair is Loaded.
    </Check>
  </Step>

  <Step>
    Select **\[ Request ]**.
  </Step>

  <Step>
    On the **Subject DN** tab, select **Classic** in the **Preset** drop-down list and specify the hostname or IP address of the KMES in the **Common** **Name** field.
  </Step>

  <Step>
    On the **V3 Extensions** tab, set the profile to **TLS Server Certificate**.
  </Step>

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

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

  <Step>
    Select **\[ OK ]** again in the **Application Public Keys** window to finish.
  </Step>
</Steps>

#### Get the CSR signed

Perform the following steps to get the CSR signed by an external CA:

<Steps>
  <Step>
    Send the CSR file to the external CA.
  </Step>

  <Step>
    After the CSR is signed, download the signed certificate and the chain of CA certificates that were used to sign it.
  </Step>
</Steps>

#### Configure the KMIP connection pair

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

<Steps>
  <Step>
    Log in to the KMES Series 3 application interface with the default Admin identities.
  </Step>

  <Step>
    Go to **Administration** > **Configuration** > **Network** **Options** and select the **TLS/SSL Settings** tab.
  </Step>

  <Step>
    Select the **Connection** drop-down option and select the **KMIP** connection pair.
  </Step>

  <Step>
    In the **User** **Certificates** section, select **\[ Edit ]** next to **Certificates**.
  </Step>

  <Step>
    In the **Certificate** **Authority** window, right-click the **KMIP SSL CA** X.509 certificate container and select **\[ Import ]**.
  </Step>

  <Step>
    In the **Import** **Certificates** window, select **\[ Add ]** at the bottom of the window.
  </Step>

  <Step>
    In the file browser, select both the root CA certificate and the signed KMIP connection pair certificate and select **\[ Open ]**.

    <Check>
      The certificates now display in the Verified section of the Import Certificates window.
    </Check>
  </Step>

  <Step>
    Select **\[ OK ]** to save.

    <Check>
      You now see Signed loaded next to Certificates in the User Certificates section of the Network Options window under the KMIP connection pair.
    </Check>
  </Step>

  <Step>
    Select **\[ OK ]** to finish.
  </Step>
</Steps>

## Method 2: Use the KMES Series 3 as the CA

To use the KMES as the CA to create the TLS certificates, perform the following tasks:

1. Create the CA.
2. Create a TLS certificate for MySQL Server.
3. Create and configure the TLS certificate for the KMIP connection pair on the KMES Series 3.
4. Generate a private key pair and create a Certificate Signing Request (CSR) for MySQL Server.

### Create the CA

Perform the following steps to create the CA:

<Steps>
  <Step>
    Log in to the KMES Series 3 application interface with the default Admin users.
  </Step>

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

  <Step>
    Specify a name for the CA and select **\[ OK ]**.
  </Step>

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

  <Step>
    Select **Classic** in the **Preset** drop-down list, then set **Common Name** to `Root`.
  </Step>

  <Step>
    On the **Basic** **Info** tab, leave all fields set to the default values.
  </Step>

  <Step>
    On the **V3 Extensions** tab, set **Profile** to **Certificate Authority** and select **\[ OK ]** to save.
  </Step>
</Steps>

### Create the TLS certificate

Perform the following tasks to create the TLS certificate for MySQL Server:

1. Generate a private key and construct a CSR for MySQL Server.
2. Sign the MySQL Server CSR.

#### Generate a private key and CSR

Perform the following steps to generate a private key and construct a CSR for MySQL Server:

<Steps>
  <Step>
    In a terminal, run the following OpenSSL command to generate a private key:

    ```shell expandable lines wrap title="Shell" theme={null}
    openssl genpkey -algorithm RSA -out key.pem
    ```
  </Step>

  <Step>
    Run the following OpenSSL command to generate a CSR, specifying `MySQL` as the **Common** **Name** in the Certificate Signing Request (CSR).:

    ```shell expandable lines wrap title="Shell" theme={null}
    openssl req -new -key key.pem -out client.csr
    ```
  </Step>
</Steps>

#### Sign the CSR

Perform the following steps to sign the MySQL Server CSR:

<Steps>
  <Step>
    Go to **PKI** > **Certificate** **Authorities**.
  </Step>

  <Step>
    Right-click the Root CA certificate and select **Add** **Certificate** > **From** **Request**.
  </Step>

  <Step>
    In the file browser, select the MySQL Server CSR.

    <Check>
      Certificate information populates in the Create X.509 From CSR window.
    </Check>
  </Step>

  <Step>
    Leave all settings exactly as they are and select **\[ OK ]** to save.

    <Check>
      The signed MySQL Server certificate now displays under the Root CA certificate in the CA tree.
    </Check>
  </Step>
</Steps>

### Create and configure the certificate

Perform the following tasks to create and configure the TLS certificate for the KMIP connection pair on the KMES Series 3:

1. Generate a private key and construct a CSR.
2. Sign the KMIP connection pair CSR.
3. Export all certificates in the CA tree.
4. Configure the KMIP connection pair to use the signed certificate and CA chain.

#### Generate a private key and a CSR

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

<Steps>
  <Step>
    Log in to the KMES Series 3 application interface with the default Admin identities.
  </Step>

  <Step>
    Go to **Administration** > **Configuration** > **Network** **Options** and go to the **TLS/SSL Settings** tab.
  </Step>

  <Step>
    Select the **Connection** drop-down option and select the **KMIP** connection pair.
  </Step>

  <Step>
    **Enable** the KMIP connection pair if it is not already enabled.
  </Step>

  <Step>
    Uncheck the **Use System/Host API SSL Parameters** checkbox if it is selected.
  </Step>

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

  <Step>
    In the **Application Public Keys** window, select **\[ Generate ]**.
  </Step>

  <Step>
    When prompted that *SSL will not be functional until new certificates are imported*, select **\[ Yes ]** to continue.
  </Step>

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

    <Check>
      The Application Public Keys window now shows that a PKI Key Pair is Loaded.
    </Check>
  </Step>

  <Step>
    Select **\[ Request ]**.
  </Step>

  <Step>
    In the **Subject DN** tab, select **Classic** from the Preset drop-down list and specify the hostname or IP address of the KMES in **Common** **Name**.
  </Step>

  <Step>
    On the **V3 Extensions** tab, set the profile to **TLS Server Certificate**.
  </Step>

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

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

  <Step>
    Select **\[ OK ]** again in the **Application Public Keys** window to finish.
  </Step>
</Steps>

#### Sign the CSR

Perform the following steps to sign the KMIP connection pair CSR:

<Steps>
  <Step>
    Go to **PKI** > **Certificate** **Authorities**.
  </Step>

  <Step>
    Right-click the Root CA certificate and select **Add Certificate** > **From Request**.
  </Step>

  <Step>
    In the file browser, select the KMIP connection pair CSR.

    <Check>
      Certificate information populates in the Create X.509 From CSR window.
    </Check>
  </Step>

  <Step>
    Leave all settings exactly as they are and select **\[ OK ]** to save.

    <Check>
      The signed KMIP connection pair certificate now displays under the Root CA certificate in the CA tree.
    </Check>
  </Step>
</Steps>

#### Export all certificates

Perform the following steps to export each certificate in the certificate tree:

<Steps>
  <Step>
    Right-click the certificates in the certificate tree and select **Export** > **Certificate(s)**.
  </Step>

  <Step>
    In the **Export** **Certificate** window, change the encoding to **PEM** and specify a save location for the file.
  </Step>
</Steps>

#### Configure the connection pair

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

<Steps>
  <Step>
    Log in to the KMES Series 3 application interface with the default Admin identities.
  </Step>

  <Step>
    Go to **Administration** > **Configuration** > **Network** **Options** and go to the **TLS/SSL Settings** tab.
  </Step>

  <Step>
    Select the **Connection** drop-down option and select the **KMIP** connection pair.
  </Step>

  <Step>
    In the **User** **Certificates** section, select **\[ Edit ]** next to **Certificates**.
  </Step>

  <Step>
    In the **Certificate** **Authority** window, right-click the **KMIP SSL CA** X.509 certificate container and select **\[ Import ]**.
  </Step>

  <Step>
    In the **Import** **Certificates** window, select **\[ Add ]** at the bottom of the window.
  </Step>

  <Step>
    In the file browser, select both the root CA certificate and the signed KMIP connection pair certificate, and select **\[ Open ]**.

    <Check>
      The certificates now display in the Verified section of the Import Certificates window.
    </Check>
  </Step>

  <Step>
    Select **\[ OK ]** to save.

    <Check>
      You now see Signed loaded next to Certificates in the User Certificates section of the Network Options window under the KMIP connection pair.
    </Check>
  </Step>

  <Step>
    Select **\[ OK ]** to save and finish.
  </Step>
</Steps>
