# Logstash can't connect to Elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch/303623>\
**Category:** Logstash\
**Tags:** elastic-stack-security\
**Created:** [April 29, 2022, 4:56pm UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch/303623 "2022-04-29T16:56:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozz](https://avatars.discourse-cdn.com/v4/letter/o/dfb087/32.png) [@ozz](https://discuss.elastic.co/u/ozz)\
**Post date:** [April 29, 2022, 4:56pm UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch/303623/1 "2022-04-29T16:56:30Z")

</div>

Hi guys.

I'm trying to connect to Elasticsearch from Logstash, but it fails due to certificate issues. To give some background data: Version 8.1.3 on Kubernetes with Rancher. I build a couple of kustomization yaml files to orchestrate the installation. (I can provide them if needed)

On Elasticsearch side I get "http client did not trust this server's certificate" and on logstash "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

Since we want to use ELK only within the company we really don't need HTTPS, because our cloud environment is not reachable externally. So I tried out this from this page ([TLS certificates | Elastic Cloud on Kubernetes [2.10] | Elastic](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-tls-certificates.html#k8s-disable-tls)) :

> spec:  
> http:  
> tls:  
> selfSignedCertificate:  
> disabled: true

But it seems I'm placing it in the wrong place all the time. Could someone tell me where's the exact place to put it, so I can reach ES via **HTTP** ://es:9200, so I don't have to deal with all those certificate issues? I googled so many placed and I'm finding only small snippets, but no complete example with a mimimal working prototype.

I'm glad for every hint. Thanks guys!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 5, 2022, 2:28am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch/303623/2 "2022-05-05T02:28:48Z")

</div>

Welcome to our community! 😃 We aren't all guys though.

We'd need more information here to help.  
Are you using ECK?  
What does your config look like?  
What are the full errors you are seeing?

---

<div class="post-metadata">

**Author:** ![ozz](https://avatars.discourse-cdn.com/v4/letter/o/dfb087/32.png) [@ozz](https://discuss.elastic.co/u/ozz)\
**Post date:** [May 6, 2022, 3:37pm UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch/303623/3 "2022-05-06T15:37:51Z")

</div>

Hi warkolm.

I found out that I don't need Logstash. Filebeat is enough for me. So I skipped that. After watching dozens of YT videos I finally got the logs into my ES.... _sigh_

And btw: to be exact, guys is for both male and female. But I will write a more gender-neutral term next time 🙂  
Thanks anyways for your help and wishing you a wonderful weekend.

---

<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:** [June 3, 2022, 3:38pm UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch/303623/4 "2022-06-03T15:38:35Z")

</div>

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