# Ssl connection between Filebeat and Logstash

**URL:** <https://discuss.elastic.co/t/ssl-connection-between-filebeat-and-logstash/82928>\
**Category:** Logstash\
**Created:** [April 19, 2017, 5:14pm UTC](https://discuss.elastic.co/t/ssl-connection-between-filebeat-and-logstash/82928 "2017-04-19T17:14:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ls4074](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@ls4074](https://discuss.elastic.co/u/ls4074)\
**Post date:** [April 19, 2017, 5:14pm UTC](https://discuss.elastic.co/t/ssl-connection-between-filebeat-and-logstash/82928/1 "2017-04-19T17:14:33Z")

</div>

Hello,

When I am setting up the SSL connection between FIlebeat and Logstash, I got the following error:

2017-04-18T16:44:07,811][ERROR][logstash.inputs.beats] Looks like you either have an invalid key or your private key was not in PKCS8 format. {:exception=\>java.lang.IllegalArgumentException: File does not contain valid private key: /opt/app/logstash/ca/blth053.bhdc.att.com.key}

Here is the filebeat yaml file:  
$ cat filebeat.yml  
filebeat.prospectors:

- input\_type: log  
paths:
  - /var/log/httpd/access\_log  
output.logstash:  
enabled: true  
hosts: ["logstash host:5044"]  
ssl.certificate\_authorities: ["/opt/app/beats/filebeat/instances/instance name/etc/rootca.cer"]  
ssl.certificate: "/opt/app/beats/filebeat/instances/instance name/etc/filebeat host.cer"  
ssl.key: "/opt/app/beats/filebeat/instances/instance name/etc/filebeat host.key.nopass"  
min\_version: '1.2'  
logging:  
files:  
path: /opt/app/beats/filebeat/instances/instance name/logs  
name: instance.log  
to\_files: true  
to\_syslog: false  
level: info

Here is the logstash conf file:

$ cat first.conf  
input {  
beats {  
port =\> 5044  
ssl =\> true  
ssl\_certificate\_authorities =\> ["/opt/app/logstash/ca/rootca.cer"]  
ssl\_certificate =\> "/opt/app/logstash/ca/logstash host.cer"  
ssl\_key =\> "/opt/app/logstash/ca/logstash host.key"  
ssl\_key\_passphrase =\> "keypass"  
tls\_min\_version =\> "1.2"  
}  
}  
output {  
elasticsearch {  
hosts =\> ["Eslaticsearch host:9200"]  
ssl =\> "true"  
cacert =\> "/opt/app/logstash/ca/rootca.cer"  
user =\> "admin"  
password =\> "xxxxxxx"  
manage\_template =\> false  
index =\> "%{[@metadata][beat]}-%{+YYYY.MM.dd}"  
document\_type =\> "%{[@metadata][type]}"  
}  
}

I wonder if anyone else has encountered this error.

Thanks!

---

<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:** [May 17, 2017, 5:26pm UTC](https://discuss.elastic.co/t/ssl-connection-between-filebeat-and-logstash/82928/2 "2017-05-17T17:26:02Z")

</div>

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