# Failed to authenticate with host "https://elastic:9200": Hostname/IP does not match certificat

**URL:** <https://discuss.elastic.co/t/failed-to-authenticate-with-host-https-elastic-9200-hostname-ip-does-not-match-certificat/308167>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [June 25, 2022, 4:34pm UTC](https://discuss.elastic.co/t/failed-to-authenticate-with-host-https-elastic-9200-hostname-ip-does-not-match-certificat/308167 "2022-06-25T16:34:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![JLeysens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jleysens/32/67404_2.png) [@JLeysens](https://discuss.elastic.co/u/JLeysens)\
**Post date:** [June 27, 2022, 1:25pm UTC](https://discuss.elastic.co/t/failed-to-authenticate-with-host-https-elastic-9200-hostname-ip-does-not-match-certificat/308167/3 "2022-06-27T13:25:39Z")

</div>

Hello @medch1 ! Have a look at this issue and the solution:

> [@Host name does not match the certificate](https://discuss.elastic.co/t/host-name-does-not-match-the-certificate/269242):
>
> Hi, I am facing Host name does not match the certificate issue in ES. I tried checking in ES forum and some has asked to disable the CN name check at code level but in the same thread we also see that its not recommended solution. I have pasted the error below, Please help if you have found any other solution otherthan disabling the hostname verification at code level. I have 2 nodes in a cluster in Elastic Search and connecting from JBoss 7.1. Please find the url for which I referred, Error…

I believe you need to set the hostnames when generating the certificate by

> ...[setting] the appropriate hostname. See the `--dns` option to [certutil](https://www.elastic.co/guide/en/elasticsearch/reference/current/certutil.html)

---

_[View the full topic](https://discuss.elastic.co/t/failed-to-authenticate-with-host-https-elastic-9200-hostname-ip-does-not-match-certificat/308167)._
