> For the complete documentation index, see [llms.txt](https://docs.cennso.com/cennso/cennso-db/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-certificate.md).

# Cennso Database Certificate

A Cennso Database Certificate is represented by the `DBTLSCertificate` Custom Resource (CR). It defines a TLS certificate used to secure connections to MySQL instances by enabling encrypted client-server communication.

The sections below provide information only about configuration parameters that you can specify in the `DBTLSCertificate` CR. You can deploy a TLS certificate before or after setting up the MySQL cluster. For more information, see the [Deploy Cennso Database](https://docs.cennso.com/cennso/cennso-db/latest/deployment-guides/cennso-database.md) and [Manage TLS certificates](https://docs.cennso.com/cennso/cennso-db/latest/operation-guides/certificates.md) guides.

## Kubernetes cluster secret reference

To deploy the Cennso Database Certificate to a Core Cluster with a MySQL instance, you must specify a reference to the [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/) so the Core Cluster is accessible. You can do this using the following configuration parameters:

```yaml
spec:
  connectionSecretRef:
    name: {CORE-CLUSTER-NAME}
    namespace: {CORE-CLUSTER-SECRET-NAMESPACE}
```

Set **spec.connectionSecretRef.name** to the name of the Core Cluster where the Cennso Database Certificate should be installed. The **spec.connectionSecretRef.namespace** configuration parameter defines the Kubernetes Namespace on the Management Cluster where the Kubernetes secret to access this Core Cluster is stored.

## Certificates placement

To install a TLS certificate for your MySQL cluster, you should specify the Kubernetes Namespace where this cluster is deployed. You can do it using the following configuration option:

```yaml
spec:
  namespace: {MYSQL-CLUSTER-NAMESPACE}
```

## Certificates validity time

To specify a validity time of a TLS certificate and the time when it should be renewed by the [cert-manager](https://cert-manager.io/), you can use the following configuration options:

```yaml
spec:
  duration: 3600h
  renewBefore: 24h
```

For more information about supported formats for the **spec.duration** and **spec.renewBefore** configuration options, see the [official cert-manager documentation](https://cert-manager.io/docs/usage/certificate/).

## Additional DNS in certificates

By default, the Cennso Database Certificate includes all Kubernetes Service names associated with a MySQL cluster. In addition, you can add additional domain names (SANs) to the TLS certificate using the following configuration option:

```yaml
spec:
  additionalSANs:
    - "*.cennso-database"
```

Wildcards are supported in the given names. For more information, see the [RFC 6125](https://www.rfc-editor.org/rfc/rfc6125#section-6.4.3).
