# API Connect offloading to ElasticSearch Error

**URL:** <https://discuss.elastic.co/t/api-connect-offloading-to-elasticsearch-error/356719>\
**Category:** Logstash\
**Created:** [April 3, 2024, 8:12pm UTC](https://discuss.elastic.co/t/api-connect-offloading-to-elasticsearch-error/356719 "2024-04-03T20:12:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2web1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m2web1/32/69804_2.png) [@m2web1](https://discuss.elastic.co/u/m2web1)\
**Post date:** [April 3, 2024, 8:12pm UTC](https://discuss.elastic.co/t/api-connect-offloading-to-elasticsearch-error/356719/1 "2024-04-03T20:12:15Z")

</div>

When attempting to offload to our ElasticSerach instance, we are seeing the following error:

```auto
[2024-04-03T20:00:32,154][INFO][logstash.outputs.elasticsearch] Failed to perform request {:message=>"PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target", :exception=>Manticore::ClientProtocolException, :cause=>#<Java::JavaxNetSsl::SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target>}
 [2024-04-03T20:00:32,156][WARN][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"https://URL-HERE:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [https://URL-HERE:9200/][Manticore::ClientProtocolException] PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"}

```

Do I need a cacert reference?

---

<div class="post-metadata">

**Author:** ![mashhurs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mashhurs/32/102090_2.png) [@mashhurs](https://discuss.elastic.co/u/mashhurs)\
**Post date:** [April 4, 2024, 12:30am UTC](https://discuss.elastic.co/t/api-connect-offloading-to-elasticsearch-error/356719/2 "2024-04-04T00:30:07Z")

</div>

How did you generate certificate?  
Does Logstash have an access to it?  
Can you try with `ssl_verification_mode => 'none'` (`ssl_certificate_verification => false` if you are using older than 11.14.0 plugin version)? and provide full debug level logs?

---

<div class="post-metadata">

**Author:** ![m2web1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m2web1/32/69804_2.png) [@m2web1](https://discuss.elastic.co/u/m2web1)\
**Post date:** [April 4, 2024, 1:07pm UTC](https://discuss.elastic.co/t/api-connect-offloading-to-elasticsearch-error/356719/3 "2024-04-04T13:07:23Z")

</div>

I have a \*.cer, \*.key , and a \*.pfx file.

I have not installed anything concerning a plugin. How do I determine the version?

---

<div class="post-metadata">

**Author:** ![mashhurs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mashhurs/32/102090_2.png) [@mashhurs](https://discuss.elastic.co/u/mashhurs)\
**Post date:** [April 4, 2024, 4:21pm UTC](https://discuss.elastic.co/t/api-connect-offloading-to-elasticsearch-error/356719/4 "2024-04-04T16:21:11Z")

</div>

To determine the plugins version, you can run `bin/logstash-plugin list --verbose` command (under the Logstash home dir) and find `logstash-output-elasticsearch` in the output list.

Please visit the [plugin doc](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html) and set `ssl_*` params properly (`ssl_enabled => true`, `ssl_certificate => path-to-your-.cer`, `ssl_key => path-to-your-cert.key`, etc...)

---

<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:** [May 2, 2024, 4:22pm UTC](https://discuss.elastic.co/t/api-connect-offloading-to-elasticsearch-error/356719/5 "2024-05-02T16:22:02Z")

</div>

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