# Cmd/enroll\_cmd.go:776 Fleet Server - Error - x509: certificate is valid for (old hostname), not (current hostname)

**URL:** <https://discuss.elastic.co/t/cmd-enroll-cmd-go-776-fleet-server-error-x509-certificate-is-valid-for-old-hostname-not-current-hostname/318427>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [November 8, 2022, 11:24am UTC](https://discuss.elastic.co/t/cmd-enroll-cmd-go-776-fleet-server-error-x509-certificate-is-valid-for-old-hostname-not-current-hostname/318427 "2022-11-08T11:24:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foe\_Clicker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/foe_clicker/32/95360_2.png) [@Foe\_Clicker](https://discuss.elastic.co/u/Foe_Clicker)\
**Post date:** [November 8, 2022, 11:24am UTC](https://discuss.elastic.co/t/cmd-enroll-cmd-go-776-fleet-server-error-x509-certificate-is-valid-for-old-hostname-not-current-hostname/318427/1 "2022-11-08T11:24:45Z")

</div>

Hi, I have the same issue like couple more people here, unfortinately they did not get any help, so I try myself:)  
Enrolling agent fails with message certificate is valid for (old hostname), not (current hostname). But I have checked certificate and it is ok- the new hostname is there. What certificate does it complain about? Does it pick up the right one?

---

<div class="post-metadata">

**Author:** ![Foe\_Clicker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/foe_clicker/32/95360_2.png) [@Foe\_Clicker](https://discuss.elastic.co/u/Foe_Clicker)\
**Post date:** [November 8, 2022, 11:38am UTC](https://discuss.elastic.co/t/cmd-enroll-cmd-go-776-fleet-server-error-x509-certificate-is-valid-for-old-hostname-not-current-hostname/318427/2 "2022-11-08T11:38:11Z")

</div>

I think I got it. It's the http cert generated by ./bin/elasticsearch-certutil http

---

<div class="post-metadata">

**Author:** ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)\
**Post date:** [November 21, 2022, 1:26pm UTC](https://discuss.elastic.co/t/cmd-enroll-cmd-go-776-fleet-server-error-x509-certificate-is-valid-for-old-hostname-not-current-hostname/318427/3 "2022-11-21T13:26:55Z")

</div>

Is your question resolved?

---

<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:** [December 19, 2022, 1:27pm UTC](https://discuss.elastic.co/t/cmd-enroll-cmd-go-776-fleet-server-error-x509-certificate-is-valid-for-old-hostname-not-current-hostname/318427/4 "2022-12-19T13:27:25Z")

</div>

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