# How to replace fleet tls cert when expired?

**URL:** <https://discuss.elastic.co/t/how-to-replace-fleet-tls-cert-when-expired/343941>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [September 27, 2023, 2:11am UTC](https://discuss.elastic.co/t/how-to-replace-fleet-tls-cert-when-expired/343941 "2023-09-27T02:11:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chengye233](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chengye233/32/120850_2.png) [@chengye233](https://discuss.elastic.co/u/chengye233)\
**Post date:** [September 27, 2023, 2:11am UTC](https://discuss.elastic.co/t/how-to-replace-fleet-tls-cert-when-expired/343941/1 "2023-09-27T02:11:58Z")

</div>

Hi, I'm using fleet -server with tls cert. Recently, the cert will be expired and I need to replace a new one.

All elastic-stack version is `8.4`

Last year, I used this command to install:

```bash
sudo elastic-agent-8.4.3-linux-x86_64/elastic-agent install --url=https://xxx:8220 \
  --fleet-server-es=https://xxx:9200 \
  --fleet-server-service-token=xxx \
  --fleet-server-policy=fleet-server-policy \
  --certificate-authorities=/opt/Elastic/certs/a_pem.crt \
  --fleet-server-cert=/opt/Elastic/certs/b.pem \
  --fleet-server-cert-key=/opt/Elastic/certs/c.key 

```

This year, after I apply new certs and replace the old cert `/opt/Elastic/certs/a_pem.crt`, `/opt/Elastic/certs/b.pem` and `/opt/Elastic/certs/c.key ` to the new certs.

I restart the fleet using:

```bash
systemctl restart elastic-agent.service

```

I check the `https://xxx:8220` cert, I find the cert is still a old cert.

So my question is how to change the fleet tls cert, I need to edit the elastic-agent.yaml or change the settings in kibana? Thakns.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 25, 2023, 2:12am UTC](https://discuss.elastic.co/t/how-to-replace-fleet-tls-cert-when-expired/343941/2 "2023-10-25T02:12:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
