# Logstash-input-beats - File does not contain valid private key

**URL:** <https://discuss.elastic.co/t/logstash-input-beats-file-does-not-contain-valid-private-key/228140>\
**Category:** Logstash\
**Created:** [April 15, 2020, 2:48pm UTC](https://discuss.elastic.co/t/logstash-input-beats-file-does-not-contain-valid-private-key/228140 "2020-04-15T14:48:57Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![quentin.legraverend](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin.legraverend/32/66373_2.png) [@quentin.legraverend](https://discuss.elastic.co/u/quentin.legraverend)\
**Post date:** [May 11, 2020, 1:47pm UTC](https://discuss.elastic.co/t/logstash-input-beats-file-does-not-contain-valid-private-key/228140/18 "2020-05-11T13:47:38Z")

</div>

Hello everyone,

I'm coming back to you. "Issue" is solved.  
The root cause of our problem was wrong permissions on the manually PCKS#8 converted key. What make us struggle a lot was the inappropriate log message from Logstash plain text logs, see:

```auto
File does not contain valid private key: my_key.pem

```

By chance, I randomly decided to try the Logstash update on a host that has JSON logging enabled. Here, the message is totally different:

```auto
could not find key file: my_key.pem

```

So here are our conclusions:

- Behaviours of our Logstash are consistent
- Our Logstash never worked with SSL Beat pipelines
- Our previous key was PCKS#1 file (with good permissions)
- When I manually converted the PCKS#1 to PCKS#8 I was stupid enough not to check the permissions again. On this point Logstash logs were not helpful, may be it can be improved a bit.

Lessons learnt:

- Biggest / more time-expensive issues are often stupid human mistakes 🙂
- JSON Logstash logs is preferable on the plain homolog

_ **TL;DR: wrong permissions on the PCKS#8 converted key.** _

Thanks for reading,  
Quentin

---

_[View the full topic](https://discuss.elastic.co/t/logstash-input-beats-file-does-not-contain-valid-private-key/228140)._
