# Opaque Logstash error when setting up SSL

**URL:** <https://discuss.elastic.co/t/opaque-logstash-error-when-setting-up-ssl/200537>\
**Category:** Logstash\
**Created:** [September 21, 2019, 5:00pm UTC](https://discuss.elastic.co/t/opaque-logstash-error-when-setting-up-ssl/200537 "2019-09-21T17:00:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tao/32/54659_2.png) [@tao](https://discuss.elastic.co/u/tao)\
**Post date:** [September 21, 2019, 5:00pm UTC](https://discuss.elastic.co/t/opaque-logstash-error-when-setting-up-ssl/200537/1 "2019-09-21T17:00:47Z")

</div>

I'm attempting to set up Logstash to communicate with ES over SSL. It's failing with a very opaque error -- no error message; only a stack trace:

```auto
[2019-09-21T18:51:12,494][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"7.3.2"}
[2019-09-21T18:51:14,005][INFO][org.reflections.Reflections] Reflections took 44 ms to scan 1 urls, producing 19 keys and 39 values 
[2019-09-21T18:51:14,965][ERROR][logstash.javapipeline] java.lib.manticore.client.pool_builder(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/lib/manticore/client.rb:397)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_6_dot_4_minus_java.lib.manticore.client.RUBY$method$pool_builder$0$ __VARARGS__ (usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/manticore_minus_0_dot_6_dot_4_minus_java/lib/manticore//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/lib/manticore/client.rb)", <...SNIP...>
[2019-09-21T18:51:14,995][ERROR][logstash.agent] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create
<main>, action_result: false", :backtrace=>nil}

```

(I had to snip the full stacktrace because posts are limited to 7000 characters; [here's the full one](https://pastebin.com/JSJMYwKN).)

Has anyone come across this before? Or is there maybe someone familiar with Logstash's codebase who can sense what type of thing is causing this error?

Here's my pipeline configuration:

```auto
input {
  beats {
    port => 5044
  }
}

output {
  elasticsearch {
    hosts => "https://localhost:9200"
    manage_template => false
    index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
    user => logstash_internal
    password => <my password>
    cacert => "/etc/logstash/elastic-stack-ca.pem"
  }
}

```

My `logstash.yml` is unchanged from the default.

And finally, my ES security configuration:

```auto
xpack.security.enabled: true

xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: localhost.p12
xpack.security.http.ssl.truststore.path: localhost.p12

discovery.type: single-node

```

---

<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:** [September 21, 2019, 7:35pm UTC](https://discuss.elastic.co/t/opaque-logstash-error-when-setting-up-ssl/200537/2 "2019-09-21T19:35:02Z")

</div>

> [@tao](#):
>
> Or is there maybe someone familiar with Logstash's codebase who can sense what type of thing is causing this error?

The stack trace points [here](https://github.com/cheald/manticore/blob/5a2fb766cb6f96ff7b1082381d65f15f6235dbb5/lib/manticore/client.rb#L397).It is setting up a socket factory. I don't know how you can get a stack trace with an empty error message.

If you change the file format and replace cacert with truststore does the behaviour change?

---

<div class="post-metadata">

**Author:** ![tao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tao/32/54659_2.png) [@tao](https://discuss.elastic.co/u/tao)\
**Post date:** [September 23, 2019, 7:52pm UTC](https://discuss.elastic.co/t/opaque-logstash-error-when-setting-up-ssl/200537/4 "2019-09-23T19:52:53Z")

</div>

It works without an error if I use a truststore instead!

The only issue with this solution is that it requires the `truststore_password` key to be set as well, even though logstash only needs the public key of the CA. I'm guessing something may have gone wrong in the .p12 -\> .pem conversion?

---

<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:** [October 21, 2019, 7:52pm UTC](https://discuss.elastic.co/t/opaque-logstash-error-when-setting-up-ssl/200537/5 "2019-10-21T19:52:59Z")

</div>

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