> For the complete documentation index, see [llms.txt](https://docs.cennso.com/cennso/cdm/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/cdm/latest/troubleshooting/stale-certificate.md).

# CDM Node serves an old certificate

CDM Node reads the certificate from the `cdm-tls-cert` Secret when it starts and keeps it in memory. After cert-manager issues a new certificate, CDM Node keeps serving the old one until its pods restart. Core Clusters that use a new domain fail the TLS handshake in the meantime.

## Symptoms

- The `Certificate` is ready, but Core Clusters still fail the TLS handshake. For the symptoms of the handshake failure, see [TLS handshake fails](https://docs.cennso.com/cennso/cdm/latest/troubleshooting/tls-handshake-failure.md).
- The names in the Secret differ from the names that CDM Node serves.

To list the names in the Secret, run:

```bash
kubectl -n cennso-system get secret cdm-tls-cert -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -ext subjectAltName
```

To list the names that CDM Node serves, run:

```bash
openssl s_client -connect {CDM_DOMAIN}:6237 -servername {CDM_DOMAIN} </dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltName
```

When the two outputs differ, CDM Node serves an old certificate.

## Possible causes

- CDM Node runs a version earlier than 1.7.0. These versions do not restart after the certificate changes.
- The Reloader component does not watch the Secret. To check the annotation that triggers the restart, run:

  ```bash
  kubectl -n cennso-system get statefulset cdm-node -o jsonpath='{.metadata.annotations}'
  ```

  The output must contain `secret.reloader.stakater.com/reload` with the value `cdm-tls-cert`.

- The Reloader pod does not run. To check it, run:

  ```bash
  kubectl -n cennso-system get deploy | grep reloader
  ```

## Solution

To resolve this issue, restart the CDM Node pods:

> [!NOTE]
> The restart takes one pod at a time. The pod that restarts is unavailable for a short time.

1. Restart the pods:

   ```bash
   kubectl -n cennso-system rollout restart statefulset cdm-node
   ```

2. Wait until the restart finishes:

   ```bash
   kubectl -n cennso-system rollout status statefulset cdm-node
   ```

   The command prints `partitioned roll out complete: 3 new pods have been updated...` when all pods run again.

3. List the names that CDM Node serves again. The output now matches the names in the Secret.
