# Does not match the certificate subject provided by the peer

**URL:** <https://discuss.elastic.co/t/does-not-match-the-certificate-subject-provided-by-the-peer/265484>\
**Category:** Logstash\
**Tags:** elastic-stack-security\
**Created:** [February 25, 2021, 2:19pm UTC](https://discuss.elastic.co/t/does-not-match-the-certificate-subject-provided-by-the-peer/265484 "2021-02-25T14:19:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyberzlo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cyberzlo/32/65490_2.png) [@cyberzlo](https://discuss.elastic.co/u/cyberzlo)\
**Post date:** [February 25, 2021, 2:19pm UTC](https://discuss.elastic.co/t/does-not-match-the-certificate-subject-provided-by-the-peer/265484/1 "2021-02-25T14:19:50Z")

</div>

`Host name 'localhost' does not match the certificate subject provided by the peer (CN=elasticsearch)`

How can I deal with it? Can I just verify certificate? I don't want hardcode any IP etc.

In `/etc/logstash/logstash.yml` I have `xpack.monitoring.elasticsearch.ssl.verification_mode: certificate` but this not help with such error. Similar option is in Kibana and it works fine...

Maybe should I change some name in ES config to fix it?

I would like to keep `ssl_certificate_verification` set to `true` because of security reasons.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 25, 2021, 4:47pm UTC](https://discuss.elastic.co/t/does-not-match-the-certificate-subject-provided-by-the-peer/265484/2 "2021-02-25T16:47:46Z")

</div>

Are you getting that from an input? A filter? An output? Which one and how is it configured?

---

<div class="post-metadata">

**Author:** ![cyberzlo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cyberzlo/32/65490_2.png) [@cyberzlo](https://discuss.elastic.co/u/cyberzlo)\
**Post date:** [February 25, 2021, 10:37pm UTC](https://discuss.elastic.co/t/does-not-match-the-certificate-subject-provided-by-the-peer/265484/3 "2021-02-25T22:37:39Z")

</div>

It is from logstash which report to elasticsearch, currently only on localhost, but will need soon also second from other PC.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 25, 2021, 10:57pm UTC](https://discuss.elastic.co/t/does-not-match-the-certificate-subject-provided-by-the-peer/265484/4 "2021-02-25T22:57:35Z")

</div>

Read through [this](https://discuss.elastic.co/t/logstash-unable-to-retrieve-license-information-from-license-server/264979/2) thread.

---

<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:** [March 25, 2021, 10:58pm UTC](https://discuss.elastic.co/t/does-not-match-the-certificate-subject-provided-by-the-peer/265484/5 "2021-03-25T22:58:31Z")

</div>

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