# Logstash to Elasticsearch over SSL Configuration

**URL:** <https://discuss.elastic.co/t/logstash-to-elasticsearch-over-ssl-configuration/103950>\
**Category:** Logstash\
**Created:** [October 13, 2017, 7:32pm UTC](https://discuss.elastic.co/t/logstash-to-elasticsearch-over-ssl-configuration/103950 "2017-10-13T19:32:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cm47](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@cm47](https://discuss.elastic.co/u/cm47)\
**Post date:** [October 13, 2017, 7:32pm UTC](https://discuss.elastic.co/t/logstash-to-elasticsearch-over-ssl-configuration/103950/1 "2017-10-13T19:32:54Z")

</div>

Hi, I am trying to achieve what is described in the title. I believe I have taken all steps for proper configuration but am receiving an error that seems like a connection is not being initiated through https.

Logstash output configuration:

output {  
elasticsearch {  
hosts =\> ["[https://X.X.X.X:9200](https://X.X.X.X:9200)"]  
ssl =\> true  
cacert =\> '/etc/logstash/ca.pem'  
sniffing =\> true  
manage\_template =\> false  
index =\> "%{[@metadata][beat]}-%{+YYYY.MM.dd}"  
document\_type =\> "%{[@metadata][type]}"  
}  
}

Logstash config:

xpack.ssl.key: /etc/elasticsearch/x-pack/key.key  
xpack.ssl.certificate: /etc/elasticsearch/x-pack/cert.crt  
xpack.ssl.certificate\_authorities: ["/etc/elasticsearch/x-pack/ca/ca.crt"]  
xpack.security.http.ssl.enabled: true

Keys being used are generated by x-pack certgen.

Error is:  
@output\_class=LogStash::Outputs::ElasticSearch\>", :error=\>"Unrecognized SSL message, plaintext connection?"

Is there some URL configuration I have to change somewhere that I missed? Any ideas why I am getting this error? Its probably simple but I am fairly new to ELK so I appreciate any help!

Thanks!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 17, 2017, 8:08pm UTC](https://discuss.elastic.co/t/logstash-to-elasticsearch-over-ssl-configuration/103950/2 "2017-10-17T20:08:18Z")

</div>

You have configured Logstash to use SSL when connecting, but have you configured ES to use SSL on port 9200?

---

<div class="post-metadata">

**Author:** ![cm47](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@cm47](https://discuss.elastic.co/u/cm47)\
**Post date:** [October 19, 2017, 9:49pm UTC](https://discuss.elastic.co/t/logstash-to-elasticsearch-over-ssl-configuration/103950/3 "2017-10-19T21:49:43Z")

</div>

I believe so. I followed instructions here: [https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html](https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html), just forgot to post elasticsearch.yml sorry. Do both transport and http ssl have to be enabled? I didnt enable transport since for now I am just testing this with one machine.

Could it be "elasticsearch.url" parameter in kibana.yml? I figured it was fine to leave this as http since the error is in logstash not kibana (although I suppose it should be https because it will probably lead to issues with kibana down the road).

---

<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:** [November 16, 2017, 9:49pm UTC](https://discuss.elastic.co/t/logstash-to-elasticsearch-over-ssl-configuration/103950/4 "2017-11-16T21:49:45Z")

</div>

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