# Logstash use https

**URL:** <https://discuss.elastic.co/t/logstash-use-https/162403>\
**Category:** Logstash\
**Created:** [December 29, 2018, 9:20am UTC](https://discuss.elastic.co/t/logstash-use-https/162403 "2018-12-29T09:20:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yerikshu](https://avatars.discourse-cdn.com/v4/letter/y/4491bb/32.png) [@Yerikshu](https://discuss.elastic.co/u/Yerikshu)\
**Post date:** [December 29, 2018, 9:20am UTC](https://discuss.elastic.co/t/logstash-use-https/162403/1 "2018-12-29T09:20:45Z")

</div>

we need to use logstash in https, and this's our configucation:  
input  
{  
http{  
host =\> "0.0.0.0"  
port =\> 8080  
additional\_codecs =\> {"application/json"=\>"json"}  
codec =\> "plain"  
threads =\> 4  
ssl =\> true  
ssl\_certificate =\> "/home/yerikyu/logstash/1673589\_radar.cmic.site\_other/1673589\_radar.cmic.site.pem"  
ssl\_key =\> "/home/yerikyu/logstash/1673589\_radar.cmic.site\_other/radar.cmic.site.pem"  
# ssl\_verify\_mode =\> "force\_peer"  
}  
}  
output  
{  
kafka {  
bootstrap\_servers =\> "0.0.0.0:9092"  
topic\_id =\> "logstash"  
compression\_type =\> "gzip"  
}  
}  
and that it's the log  
[2018-12-29T16:59:56,258][ERROR][logstash.pipeline] Error registering plugin {:pipeline\_id=\>"main", :plugin=\>"\<LogStash::Inputs::Http ssl\_certificate=\>"/home/yerikyu/logstash/1673589\_radar.cmic.site\_other/1673589\_radar.cmic.site.pem", codec=\>\<LogStash::Codecs::Plain id=\>"plain\_f3f1da65-a448-461e-83e9-fae75827fb87", enable\_metric=\>true, charset=\>"UTF-8"\>, ssl\_key=\>"/home/yerikyu/logstash/1673589\_radar.cmic.site\_other/radar.cmic.site.pem", port=\>8080, additional\_codecs=\>{"application/json"=\>"json"}, host=\>"0.0.0.0", threads=\>4, id=\>"bd494b1de12503353ced24be4fcf4a0821c00328780e4918685476e8e73d4fcd", ssl=\>true, enable\_metric=\>true, ssl\_verify\_mode=\>"none", ssl\_handshake\_timeout=\>10000, tls\_min\_version=\>1, tls\_max\_version=\>1.2, cipher\_suites=\>["TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_GCM\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_256\_GCM\_SHA384", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_GCM\_SHA256", "TLS\_ECDHE\_RSA\_WITH\_AES\_128\_GCM\_SHA256", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_256\_CBC\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_128\_CBC\_SHA256", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_CBC\_SHA256"], response\_headers=\>{"Content-Type"=\>"text/plain"}, remote\_host\_target\_field=\>"host", request\_headers\_target\_field=\>"headers", max\_pending\_requests=\>200, max\_content\_length=\>104857600, verify\_mode=\>"none"\>", :error=\>"File does not contain valid private key: /home/yerikyu/logstash/1673589\_radar.cmic.site\_other/radar.cmic.site.pem", :thread=\>"#\<Thread:0x5ecdaa7 run\>"}  
[2018-12-29T16:59:56,288][INFO][org.apache.kafka.clients.producer.KafkaProducer] [Producer clientId=producer-1] Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.  
[2018-12-29T16:59:56,293][ERROR][logstash.pipeline] Pipeline aborted due to error {:pipeline\_id=\>"main", :exception=\>java.lang.IllegalArgumentException: File does not contain valid private key: /home/yerikyu/logstash/1673589\_radar.cmic.site\_other/radar.cmic.site.pem, :backtrace=\>[

So, how can i solve it?Thanks everybody

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [December 29, 2018, 12:02pm UTC](https://discuss.elastic.co/t/logstash-use-https/162403/2 "2018-12-29T12:02:25Z")

</div>

> [@Yerikshu](#):
>
> exception=\>java.lang.IllegalArgumentException: File does not contain valid private key: /home/yerikyu/logstash/1673589\_radar.cmic.site\_other/radar.cmic.site.pem

The error message is pretty clear: `/home/yerikyu/logstash/1673589_radar.cmic.site_other/radar.cmic.site.pem` is not a valid Private Key file. This doesn't appear to be a Logstash specific issue, you need to have a valid Private key and the relevant Certificate file in order to enable https.

If you generated the key and certificate yourself, how did you do it?  
If you received the key and certificate from somewhere, please verify that the files are correct.

For instance you can verify your private key file with

```auto
openssl rsa -in home/yerikyu/logstash/1673589_radar.cmic.site_other/radar.cmic.site.pem -check -noout

```

which should output:

```auto
RSA key ok

```

---

<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:** [January 26, 2019, 12:02pm UTC](https://discuss.elastic.co/t/logstash-use-https/162403/3 "2019-01-26T12:02:33Z")

</div>

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