# Logstash Error after setting up TLS on Elastic

**URL:** https://discuss.elastic.co/t/logstash-error-after-setting-up-tls-on-elastic/255055
**Category:** Logstash
**Tags:** elastic-stack-security
**Created:** [November 11, 2020, 12:24pm UTC](https://discuss.elastic.co/t/logstash-error-after-setting-up-tls-on-elastic/255055 "2020-11-11T12:24:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)
#### Post date: [November 11, 2020, 12:24pm UTC](https://discuss.elastic.co/t/logstash-error-after-setting-up-tls-on-elastic/255055/1 "2020-11-11T12:24:52Z")

</div>

I have enabled security on Elastic and setup HTTP/TLS for communication between Elastic and Kibana. Elastic and Kibana are now up and working fine with those new changes.  
I have just setup the following for Logstash for these new changes in the conf file:

```
ssl => true
cacert => "D:\Logstash\logstash-7.9.2\config\certs\elasticsearch-ca.pem"

```

However, after restarting the service I am still getting the following error in the Elastic logs:

```
`[2020-11-11T12:04:21,632][WARN][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [SV-MSE-ELTC-001] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/10.103.186.210:9200, remoteAddress=/10.103.186.203:57493}

```

`

---

<div class="post-metadata">

### Author: ![BBQigniter](https://avatars.discourse-cdn.com/v4/letter/b/3da27b/32.png) [@BBQigniter](https://discuss.elastic.co/u/BBQigniter)
#### Post date: [November 11, 2020, 12:30pm UTC](https://discuss.elastic.co/t/logstash-error-after-setting-up-tls-on-elastic/255055/2 "2020-11-11T12:30:18Z")

</div>

make sure that you also use https in your output section e.g.

```auto
output {
    elasticsearch {
            id => "elasticsearch_logstash_filebeat_ilm_dlq"
            manage_template => false
            codec => json_lines
            cacert => "/etc/logstash/certs/elasticsearch-ca.pem"
            user => "logstash_internal"
            password => "supersecure"
            ssl => true
           index => "some-nice-index"
            # the elasticsearch ouptut plugin will loadbalance :D - IPs obfuscated
            hosts => ["https://123.123.123.123:9200", "https://123.123.123.124:9200"]
        }
}

```

I hope i didn't miss something - just copy&pasted it and removed a few lines

---

<div class="post-metadata">

### Author: ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)
#### Post date: [November 11, 2020, 1:14pm UTC](https://discuss.elastic.co/t/logstash-error-after-setting-up-tls-on-elastic/255055/3 "2020-11-11T13:14:14Z")

</div>

Hiya, thanks, I forgot to change host from HTTP to HTTPS, however still seem to be getting the same error as before. The output I have is:

```auto
output {
  elasticsearch {
    hosts => "https://10.10.10.10:9200"
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
	user => "${ES_USER}"
    password => "${ES_PWD}"
	ssl => true
	cacert => "D:\Logstash\logstash-7.9.2\config\certs\elasticsearch-ca.pem"
  }
}

```

---

<div class="post-metadata">

### Author: ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)
#### Post date: [November 12, 2020, 9:09am UTC](https://discuss.elastic.co/t/logstash-error-after-setting-up-tls-on-elastic/255055/4 "2020-11-12T09:09:36Z")

</div>

OK, looks like I got Logstash setup to go to Elasticsearch now:

`[2020-11-12T09:05:57,230][WARN][logstash.outputs.elasticsearch][main] Restored connection to ES instance {:url=>"https://logstash_internal:xxxxxx@10.10.10.10:9200/"}`

---

<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: [December 10, 2020, 9:10am UTC](https://discuss.elastic.co/t/logstash-error-after-setting-up-tls-on-elastic/255055/5 "2020-12-10T09:10:07Z")

</div>

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