# Logstash is unable to send data when Elastic is configured with SSL in 7.1

**URL:** <https://discuss.elastic.co/t/logstash-is-unable-to-send-data-when-elastic-is-configured-with-ssl-in-7-1/183383>\
**Category:** Logstash\
**Created:** [May 29, 2019, 4:08pm UTC](https://discuss.elastic.co/t/logstash-is-unable-to-send-data-when-elastic-is-configured-with-ssl-in-7-1/183383 "2019-05-29T16:08:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Agrawal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_agrawal/32/74982_2.png) [@Prashant\_Agrawal](https://discuss.elastic.co/u/Prashant_Agrawal)\
**Post date:** [May 29, 2019, 4:08pm UTC](https://discuss.elastic.co/t/logstash-is-unable-to-send-data-when-elastic-is-configured-with-ssl-in-7-1/183383/1 "2019-05-29T16:08:17Z")

</div>

Hello Team,  
I have setup one box setup of Elastic and Kibana with SSL and HTTPS.

I used the ca.crt as generated by  
`openssl pkcs12 -in elastic-stack-ca.p12 -out ca.crt -nokeys`

As well as tried the instance.crt generated by:  
`/usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 --pem`

But while running the logstash it is giving the error.. Conf and log details are as below:

**ls\_conf\_snippet:**  
[root@ip-172-31-28-36 pagrawal]# cat Aladdin\_ls.conf

> input {  
> elasticsearch {  
> hosts =\> "[https://localhost:9200](https://localhost:9200)"  
> index =\> "twitter1,twitter2"  
> ssl =\> "true"  
> ca\_file =\> "/etc/elasticsearch/ca.crt"  
> }  
> }

**Error:**

> [2019-05-28T16:44:09,344][ERROR][logstash.javapipeline] A plugin had an unrecoverable error. Will restart this plugin.  
> Pipeline\_id:main  
> Plugin: \<LogStash::Inputs::Elasticsearch index=\>"twitter1,twitter2", id=\>"b95e5e59170b162a01d02cc7cd65c379bcb33a7623ba487ea7760e3ce7b7de1d", ca\_file=\>"/etc/elasticsearch/ca.crt", ssl=\>true, hosts=\>["[https://localhost:9200](https://localhost:9200)"], enable\_metric=\>true, codec=\>\<LogStash::Codecs::JSON id=\>"json\_979ce11c-6f98-4a53-acbd-547cd2f738cd", enable\_metric=\>true, charset=\>"UTF-8"\>, query=\>"{ "sort": ["\_doc"] }", size=\>1000, scroll=\>"1m", docinfo=\>false, docinfo\_target=\>"@metadata", docinfo\_fields=\>["\_index", "\_type", "\_id"]\>  
> Error: Failed to open TCP connection to https:0 (initialize: name or service not known)  
> Exception: Faraday::ConnectionFailed

**Whereas curl works fine with same ca.crt:**

> [root@ip-172-31-28-36 pagrawal]# curl --cacert /etc/elasticsearch/ca.crt -XGET [https://localhost:9200/\_cat/indices?v](https://localhost:9200/_cat/indices?v)  
> health status index uuid pri rep docs.count docs.deleted store.size pri.store.size  
> green open .kibana\_task\_manager TmJ9H1\_\_Tk-VbO7cMbCQ\_Q 1 0 2 2 9.3kb 9.3kb

Any thoughts ?

---

<div class="post-metadata">

**Author:** ![Prashant\_Agrawal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_agrawal/32/74982_2.png) [@Prashant\_Agrawal](https://discuss.elastic.co/u/Prashant_Agrawal)\
**Post date:** [June 2, 2019, 7:21am UTC](https://discuss.elastic.co/t/logstash-is-unable-to-send-data-when-elastic-is-configured-with-ssl-in-7-1/183383/2 "2019-06-02T07:21:55Z")

</div>

Hello Team,

Any thoughts or updates..

---

<div class="post-metadata">

**Author:** ![Prashant\_Agrawal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_agrawal/32/74982_2.png) [@Prashant\_Agrawal](https://discuss.elastic.co/u/Prashant_Agrawal)\
**Post date:** [June 4, 2019, 12:35pm UTC](https://discuss.elastic.co/t/logstash-is-unable-to-send-data-when-elastic-is-configured-with-ssl-in-7-1/183383/3 "2019-06-04T12:35:40Z")

</div>

An update: Logstash with output as elasticsearch works fine with the ca.crt generated as per [this post](https://discuss.elastic.co/t/no-living-connection-in-kibana-7-1-0-while-using-default-security-provided-in-7-1/182215/14), where as it does not work for logstash input as elasticsearch.

Logstash working conf as output:

> ```
> input {
> stdin {} 
> }
> output {
> stdout {codec => rubydebug}
> elasticsearch {
> hosts => ["https://172.31.28.36:9200"]
> cacert => "/etc/kibana/ca.crt"
> }
> }
> 
> ```

Logstash input conf which does not works:

> ```
> input {
> stdin {} 
> elasticsearch {
> hosts => "https://172.31.28.36:9200"
> index => "twitter1"
> ssl => "true"
> ca_file => "/etc/kibana/ca.crt"
> }
> }
> output {
> stdout {codec => rubydebug}
> elasticsearch {
> hosts => ["https://172.31.28.36:9200"]
> cacert => "/etc/kibana/ca.crt"
> }
> }
> 
> ```

Any thought why same cert does not work for input?

---

<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:** [July 2, 2019, 12:35pm UTC](https://discuss.elastic.co/t/logstash-is-unable-to-send-data-when-elastic-is-configured-with-ssl-in-7-1/183383/4 "2019-07-02T12:35:41Z")

</div>

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