# Filebeat TLS connect to Logstash fails

**URL:** https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761
**Category:** Beats
**Tags:** filebeat
**Created:** [April 19, 2016, 7:41am UTC](https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761 "2016-04-19T07:41:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![cs1](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@cs1](https://discuss.elastic.co/u/cs1)
#### Post date: [April 19, 2016, 7:41am UTC](https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761/1 "2016-04-19T07:41:34Z")

</div>

Hi all!

We've set up Logstash to collect Filebeat data via the beats plugin:

```
input {
  beats {
    port => 5044
    ssl => true
    ssl_certificate_authorities => ["/etc/logstash/certs/ca.cert.pem"]
    ssl_certificate => "/etc/logstash/certs/server.cert.pem"
    ssl_key => "/etc/logstash/server.pem"
    ssl_verify_mode => "force_peer"
    type => "logs"
  }
}

```

Logstash starts using this configuration (filter section is empty for now, all output goes to stdout). The Logstash server is on a different network segment than the Filebeat server so we opened the firewall to let Filebeat traffic pass. We've verified with telnet that we can actually connect to the Logstash server. A tcpdump on the Logstash server shows that packets arrive and everything's fine. Filebeat is configured like this in the output section:

```
output:
  logstash:
    hosts: ["server.fqdn.here:5044"]
    tls:
      certificate_authorities: ["/etc/filebeat/ca.cert.pem"]
      certificate: "/etc/filebeat/filebeat-client.cert.pem"
      certificate_key: "/etc/filebeat/filebeat-client.key.pem"

```

When we start Filebeat with this configuration, we get the following error messages:

```
transport.go:125: ERR SSL client failed to connect with: EOF
single.go:126: INFO Connecting error publishing events (retrying): EOF
single.go:152: INFO send fail
single.go:159: INFO backoff retry: 16s

```

We can see in the tcpdump output that packets are exchanged between Logstash and Filebeat servers, however, we don't see why the connection fails. All the solutions in other posts in the forum to the "ERR SSL client failed to connect with: EOF" error don't seem to work for us. Also, changing

```
ssl_verify_mode => "force_peer"

```

to

```
ssl_verify_mode => "peer"

```

didn't work either. Please note that we have FQDNs in the certificates (own private CA without Intermediate CAs) and use the FQDN in the Filebeat configuration. We don't have SANs in the certificates.

We have the following software versions installed:

- Logstash: 2.2.4,
- Beats input plugin: 2.2.8,
- Filebeat: 1.2.1

It'd be great if someone could point us in the right direction. Running Logstash with "-v --debug --verbose" didn't yield any useful output. Any help would be highly appreciated. Thanks!

cs1

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [April 19, 2016, 12:38pm UTC](https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761/2 "2016-04-19T12:38:43Z")

</div>

out of curiosity, when doing tcpdump which side did send the FIN flag.

Let's try step by step. First tcp only. Next ssl enabled, but client auth disabled.

---

<div class="post-metadata">

### Author: ![cs1](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@cs1](https://discuss.elastic.co/u/cs1)
#### Post date: [April 19, 2016, 1:01pm UTC](https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761/3 "2016-04-19T13:01:29Z")

</div>

Hi Steffen,

thanks for your reply. Unfortunately I didn't capture any pcap files so I don't have the output anymore right know (please read on why).

I think that we "solved" the problem. We used a private CA because we thought that we couldn't use our PKI since we read that signed certs from intermediate CAs can't be used with Filebeat. After having trouble with the certificates from our private CA (we still don't know what the problem is because the SSL connection using "openssl s\_client -connect ..." to connect to Logstash worked) we simply tried certificates from our PKI that we already had on the machines and that were signed by an intermediate CA. And to our surprise, that works like a charm. As CA file we use a file containing the whole chain of the Root CA - Intermediate CA - RA and we also have that chain embedded in the signed certs. So now everything's even better than before because now we can use globally valid CA certs. Still, I have no idea whatsoever what Filebeat's problem was with the original certificates because our openssl connection test worked.

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [April 19, 2016, 2:00pm UTC](https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761/4 "2016-04-19T14:00:42Z")

</div>

It's kinda funny. I head jruby (logstash side) having problems with intermediate CAs, but not sure.

---

<div class="post-metadata">

### Author: ![cs1](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@cs1](https://discuss.elastic.co/u/cs1)
#### Post date: [April 19, 2016, 2:23pm UTC](https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761/5 "2016-04-19T14:23:03Z")

</div>

We use intermediate CA signed certs on both sides. Everything seems to be working nicely so far. And ssl\_verify\_mode =\> "force\_peer" is set so my guess is that everything's in order TLS-wise.

---

<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 5, 2017, 9:53pm UTC](https://discuss.elastic.co/t/filebeat-tls-connect-to-logstash-fails/47761/6 "2017-07-05T21:53:00Z")

</div>


