# "File does not contain valid private key:/usr/share/logstash/ssl/server.key" error in input pipeline Logstash. How fix it?

**URL:** <https://discuss.elastic.co/t/file-does-not-contain-valid-private-key-usr-share-logstash-ssl-server-key-error-in-input-pipeline-logstash-how-fix-it/235980>\
**Category:** Logstash\
**Created:** [June 5, 2020, 3:58pm UTC](https://discuss.elastic.co/t/file-does-not-contain-valid-private-key-usr-share-logstash-ssl-server-key-error-in-input-pipeline-logstash-how-fix-it/235980 "2020-06-05T15:58:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Foxis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_foxis/32/69811_2.png) [@Andrew\_Foxis](https://discuss.elastic.co/u/Andrew_Foxis)\
**Post date:** [June 5, 2020, 3:58pm UTC](https://discuss.elastic.co/t/file-does-not-contain-valid-private-key-usr-share-logstash-ssl-server-key-error-in-input-pipeline-logstash-how-fix-it/235980/1 "2020-06-05T15:58:11Z")

</div>

Hi all!

I get certificate from MS CA.  
Then convert it:

```auto
    openssl pkcs12 -in test.pfx -out ca.crt -nodes -nokeys -cacerts
    openssl pkcs12 -in test.pfx -clcerts -nokeys -out server.crt
    openssl pkcs12 -in test.pfx -nocerts -nodes -out server.key

```

```
Then i configure Logstash input:

```

```auto
    input {
      beats {
        port => 5044
        ssl => true
        ssl_certificate_authorities => ["/usr/share/logstash/ssl/ca.crt"]
        ssl_certificate => "/usr/share/logstash/ssl/server.crt"
        ssl_key => "/usr/share/logstash/ssl/server.key"
        ssl_verify_mode => "none"
      }
    }

```

Theni started Logstash and get error:  
"File does not contain valid private key:/usr/share/logstash/ssl/server.key"

Help me please. What i do wrong? How fix it?

Thank you

---

<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 3, 2020, 3:58pm UTC](https://discuss.elastic.co/t/file-does-not-contain-valid-private-key-usr-share-logstash-ssl-server-key-error-in-input-pipeline-logstash-how-fix-it/235980/2 "2020-07-03T15:58:13Z")

</div>

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