Certificate Enrollment and CA Communication

This section is written as a standalone operating procedure for Anthony. It covers the first communication between the OVHcloud environment and your GT Host Certificate Authority, including the differences between generating a CSR on the MariaDB server and generating one on the application server.

Certificate Enrollment and CA Communication

Document: PKI-002 — Certificate Enrollment and Issuance
Environment: OVHcloud / RHEL 9.8 / MariaDB 10.11 / ServiceNow Application Server
Certificate Authority: GT Host — issuing-ca-01
Classification: Technical Operating Procedure
Prerequisite: Private Root CA successfully created and verified

1. Purpose

This procedure establishes the process by which the OVHcloud MariaDB server and ServiceNow application server obtain certificates from the private Certificate Authority (CA).

It simulates the enterprise certificate enrollment process normally performed between infrastructure teams and an organization’s PKI/security team.

The fundamental rule is that each server generates its own private key, requests a certificate from the CA, and receives a signed certificate.

The Certificate Authority does not need administrative access to either OVHcloud server.

2. Certificate enrollment architecture

                GT HOST

           PRIVATE CERTIFICATE

               AUTHORITY

             issuing-ca-01

                   |

            Receives CSRs

            Signs requests

            Returns certificates

                   |

         +———+———+

         |                   |

         v                   v

    OVHCLOUD              OVHCLOUD

    MariaDB               Application

    Server                Server

         |                   |

    Server key           Client key

    Server CSR           Client CSR

    Server cert          Client cert

         |                   |

         +———+———+

                   |

              MariaDB mTLS

The CA server is responsible for issuing certificates.

The MariaDB and application servers are responsible for generating and protecting their own private keys.

The CA server does not participate in normal database connections after certificates have been issued.

3. Determine where certificate enrollment must occur

There are two separate certificate identities.

CertificateWhere the private key must be generatedPurpose
MariaDB server certificateMariaDB host, preferablyProves the identity of the database server
ServiceNow client certificateApplication host, preferablyProves the identity of the application client

3.1 Preferred method — Generate each CSR on its destination server

The MariaDB team generates the MariaDB server key and CSR on the database host.

The application team generates the application client key and CSR on the application host.

Each team sends its CSR to the CA for signing.

This preserves private-key ownership and follows standard enterprise security practices.

3.2 Alternative — Generate the MariaDB CSR from the application server

If direct administrative access to the MariaDB server is unavailable, the application server may be used as a temporary certificate-enrollment workstation, subject to approval.

In this case:

  1. Generate a new MariaDB server private key on the application server.
  2. Generate the MariaDB server CSR using that key.
  3. Send the CSR to the CA for signing.
  4. Receive the signed server certificate.
  5. Securely transfer the signed certificate, public CA certificate, and corresponding MariaDB private key to the MariaDB host.
  6. Remove the temporary MariaDB private-key copy from the application server after verifying installation and any approved backup requirements.

Important: This method changes where the MariaDB private key is initially created and exposes it to an additional machine.

It does not change the certificate’s purpose. The certificate must still identify the MariaDB server, not the application server.

The preferred method remains generating the key directly on MariaDB.

3.3 What does not change

Regardless of the enrollment workstation:

  • The MariaDB certificate must identify the actual database server.
  • The application client certificate must identify the application client.
  • Each certificate must have its own private key.
  • The CA must sign each CSR.
  • The private CA signing key must remain on the CA server.
  • MariaDB and the application must receive the appropriate public CA certificate.

4. MariaDB server certificate enrollment

Execution host: OVHcloud MariaDB server, unless the approved alternative is used.

Step 4.1 — Identify the database connection endpoint

Determine the exact hostname and IP address used by ServiceNow to connect to MariaDB.

Record:

DB_HOSTNAME = _______________________

DB_IP       = _______________________

DB_PORT     = 3306

The certificate must include the relevant hostname or IP address in its Subject Alternative Name (SAN).

Do not use the CA hostname or application hostname as the MariaDB certificate identity.

Step 4.2 — Create the certificate directory

sudo install -d \

  -o root -g mysql \

  -m 750 /etc/pki/mariadb

Confirm that the MariaDB service runs under the expected account and group before applying ownership.

Step 4.3 — Generate the MariaDB private key

sudo openssl genpkey \

  -algorithm RSA \

  -pkeyopt rsa_keygen_bits:3072 \

  -out /etc/pki/mariadb/server-key.pem

Apply permissions:

sudo chown root:mysql \

  /etc/pki/mariadb/server-key.pem

sudo chmod 640 \

  /etc/pki/mariadb/server-key.pem

This private key belongs to the MariaDB server.

It shall not be submitted to the CA.

Step 4.4 — Generate the CSR

Replace DB_HOSTNAME and DB_IP with actual values.

sudo openssl req \

  -new \

  -sha256 \

  -key /etc/pki/mariadb/server-key.pem \

  -out /etc/pki/mariadb/server.csr \

  -subj “/O=OVHcloud Lab/CN=DB_HOSTNAME” \

  -addext “subjectAltName=DNS:DB_HOSTNAME,IP:DB_IP”

If clients connect only by DNS, the IP SAN may be omitted. If they connect by IP, the IP SAN must be present.

Step 4.5 — Inspect the CSR

sudo openssl req \

  -in /etc/pki/mariadb/server.csr \

  -noout -text -verify

Confirm the requested subject and SAN values.

Step 4.6 — Submit the CSR to the CA team

The MariaDB team shall submit:

server.csr

Along with:

Request type: TLS Server Certificate

Requested EKU: serverAuth

Server hostname: DB_HOSTNAME

Server IP: DB_IP

Issuing authority: GT Host Test Root CA

The request may be transferred using SCP, SFTP, or another approved secure-transfer mechanism.

The CA and MariaDB servers do not require a persistent network connection.


5. Certificate Authority processing

Execution host: GT Host issuing-ca-01

Step 5.1 — Receive the MariaDB CSR

Place the CSR at:

/opt/pki/csr/server.csr

Step 5.2 — Inspect the request

cd /opt/pki

openssl req \

  -in csr/server.csr \

  -noout -text -verify

The CA administrator shall verify that the requested identity corresponds to the intended MariaDB endpoint.

Step 5.3 — Define the server certificate profile

Create:

/opt/pki/server.ext

Contents:

basicConstraints=critical,CA:FALSE

keyUsage=critical,digitalSignature,keyEncipherment

extendedKeyUsage=serverAuth

subjectAltName=DNS:DB_HOSTNAME,IP:DB_IP

Replace the placeholders with the approved endpoint values.

The CA administrator shall not issue a certificate containing unverified or incorrect server identities.

Step 5.4 — Sign the CSR

openssl x509 \

  -req \

  -in csr/server.csr \

  -CA certs/root-ca.crt \

  -CAkey private/root-ca.key \

  -CAcreateserial \

  -out issued/server-cert.pem \

  -days 90 \

  -sha256 \

  -extfile server.ext

OpenSSL will request the Root CA private-key passphrase.

Step 5.5 — Verify the issued certificate

openssl verify \

  -CAfile certs/root-ca.crt \

  -purpose sslserver \

  issued/server-cert.pem

Expected:

issued/server-cert.pem: OK

The CA administrator shall also inspect the subject, SAN, validity period, and Extended Key Usage.

Step 5.6 — Return the issued certificate

The CA team shall return:

root-ca.crt

server-cert.pem

The CA private signing key shall remain on issuing-ca-01.


6. MariaDB certificate installation

Execution host: OVHcloud MariaDB server

Step 6.1 — Install the returned files

Copy the issued certificate and public CA certificate into:

/etc/pki/mariadb/

Required final contents:

/etc/pki/mariadb/

├── root-ca.crt

├── server-cert.pem

├── server-key.pem

└── server.csr

Step 6.2 — Set permissions

sudo chown root:mysql \

  /etc/pki/mariadb/root-ca.crt \

  /etc/pki/mariadb/server-cert.pem \

  /etc/pki/mariadb/server-key.pem

sudo chmod 640 \

  /etc/pki/mariadb/root-ca.crt \

  /etc/pki/mariadb/server-cert.pem \

  /etc/pki/mariadb/server-key.pem

Step 6.3 — Verify the certificate

sudo openssl verify \

  -CAfile /etc/pki/mariadb/root-ca.crt \

  -purpose sslserver \

  /etc/pki/mariadb/server-cert.pem

Expected:

/etc/pki/mariadb/server-cert.pem: OK

Step 6.4 — Verify the certificate/private-key pair

Run:

sudo openssl x509 \

  -in /etc/pki/mariadb/server-cert.pem \

  -pubkey -noout |

openssl pkey -pubin -outform DER |

sha256sum

Then:

sudo openssl pkey \

  -in /etc/pki/mariadb/server-key.pem \

  -pubout -outform DER |

sha256sum

The resulting hashes must match.

If they do not match, the certificate and private key do not belong to the same key pair.


7. Configure MariaDB to present its certificate

Execution host: OVHcloud MariaDB server

Back up the existing MariaDB configuration and inspect existing TLS settings before making changes.

Where no conflicting TLS settings exist, create or update the appropriate MariaDB configuration fragment:

[mariadb]

ssl_ca=/etc/pki/mariadb/root-ca.crt

ssl_cert=/etc/pki/mariadb/server-cert.pem

ssl_key=/etc/pki/mariadb/server-key.pem

Verify SELinux access while enforcing:

getenforce

sudo ls -lZ /etc/pki/mariadb

Restart MariaDB during an approved test window:

sudo systemctl restart mariadb

Check:

sudo systemctl status mariadb –no-pager

Verify TLS:

sudo mariadb -e “

SHOW GLOBAL VARIABLES

WHERE Variable_name IN

(‘have_ssl’,’ssl_ca’,’ssl_cert’,’ssl_key’);

“

Expected:

have_ssl    YES

This confirms server-side TLS configuration. It does not yet prove mutual TLS.


8. Application server certificate enrollment

Execution host: OVHcloud ServiceNow application server

The application server follows the same CA enrollment process, but requests a client certificate, not a server certificate.

Step 8.1 — Generate the client private key

Create a protected working directory appropriate for the application service account.

For initial enrollment:

sudo install -d \

  -o root -g root \

  -m 700 /etc/pki/servicenow-client

Generate the private key:

sudo openssl genpkey \

  -algorithm RSA \

  -pkeyopt rsa_keygen_bits:3072 \

  -out /etc/pki/servicenow-client/client-key.pem

sudo chmod 600 \

  /etc/pki/servicenow-client/client-key.pem

Step 8.2 — Generate the client CSR

sudo openssl req \

  -new \

  -sha256 \

  -key /etc/pki/servicenow-client/client-key.pem \

  -out /etc/pki/servicenow-client/client.csr \

  -subj “/O=OVHcloud Lab/CN=servicenow-mtls-client”

The client CSR identifies the application client.

It does not need to identify the MariaDB server.

Step 8.3 — Submit the client CSR to the CA

Transfer:

client.csr

The requested certificate profile shall include:

Certificate type: TLS Client Certificate

Extended Key Usage: clientAuth

Subject: CN=servicenow-mtls-client

Issuing authority: GT Host Test Root CA

Step 8.4 — CA signs the client CSR

On issuing-ca-01, create:

/opt/pki/client.ext

Contents:

basicConstraints=critical,CA:FALSE

keyUsage=critical,digitalSignature

extendedKeyUsage=clientAuth

Sign:

cd /opt/pki

openssl x509 \

  -req \

  -in csr/client.csr \

  -CA certs/root-ca.crt \

  -CAkey private/root-ca.key \

  -CAcreateserial \

  -out issued/client-cert.pem \

  -days 90 \

  -sha256 \

  -extfile client.ext

Verify:

openssl verify \

  -CAfile certs/root-ca.crt \

  -purpose sslclient \

  issued/client-cert.pem

Expected:

issued/client-cert.pem: OK

Step 8.5 — Return the client certificate

The CA team returns:

root-ca.crt

client-cert.pem

The application team retains:

client-key.pem

The three files are subsequently used to configure the application’s Java TLS truststore and client keystore.

This procedure does not authorize overwriting the existing ServiceNow KMF keystore.


9. Differences between MariaDB and application certificates

RequirementMariaDB serverServiceNow application
TLS roleServerClient
Private keyserver-key.pemclient-key.pem
CSRserver.csrclient.csr
Signed certificateserver-cert.pemclient-cert.pem
Extended Key UsageserverAuthclientAuth
Subject Alternative NameMust match DB connection hostname/IPNot generally required for the MariaDB client-certificate role
Public CA certificateRequiredRequired
Certificate configurationMariaDB ssl_* settingsJava/JDBC truststore and keystore
Private key submitted to CANoNo

Both certificates may be issued by the same private CA, but they represent different identities and must use separate private keys.


10. Certificate handoff and communication requirements

The CA team shall provide the following information with each issued certificate:

  • Certificate filename.
  • Issuing CA identity.
  • Certificate subject.
  • Subject Alternative Names, where applicable.
  • Certificate serial number.
  • Validity start and expiration dates.
  • SHA-256 certificate fingerprint.
  • Intended Extended Key Usage.

The receiving team shall verify that the issued certificate matches the original CSR and private key before installing it.

The receiving team shall not assume that successful certificate issuance proves the application or database is configured correctly.


11. Completion criteria

CA team

  • MariaDB server CSR received and verified.
  • MariaDB server certificate issued with serverAuth.
  • Public Root CA certificate provided.
  • Application client CSR received and verified.
  • Application client certificate issued with clientAuth.
  • CA private signing key remains protected on GT Host.

MariaDB team

  • MariaDB private key generated and protected.
  • MariaDB CSR submitted.
  • Signed certificate received.
  • Certificate chain and private-key correspondence verified.
  • MariaDB TLS configuration completed.
  • MariaDB service successfully restarted.
  • TLS enabled with SELinux enforcing.

Application team

  • Application client private key generated and protected.
  • Client CSR submitted.
  • Signed client certificate received.
  • Certificate verified against the CA.
  • Client certificate and key ready for Java/JDBC configuration.

Definition of done

The private CA has successfully issued distinct certificates to the MariaDB server and ServiceNow application server.

MariaDB is configured to present its CA-signed server certificate, and the application team possesses the client certificate material needed for mutual TLS.

Next procedure: Configure the MariaDB application account to require X.509 client certificates, configure Java/JDBC to present the application certificate, and perform positive and negative mTLS connection tests with SELinux enforcing.

Add the actual MariaDB conversation walkthrough

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *