# Logstash: TCP output with tls is not working

**URL:** <https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193>\
**Category:** Logstash\
**Created:** [June 1, 2018, 10:05am UTC](https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193 "2018-06-01T10:05:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahibabar](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mahibabar](https://discuss.elastic.co/u/mahibabar)\
**Post date:** [June 1, 2018, 10:05am UTC](https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193/1 "2018-06-01T10:05:23Z")

</div>

Hello,

I am trying to send events over secure TCP from logstash but facing issues with ssl settings:

Pipeline aborted due to error {:pipeline\_id=\>"main", :exception=\>#\<OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key:\>

Here is my config:  
tcp {  
port =\> 11111  
host =\> "xx.xx.xx.xx"  
ssl\_enable =\> true  
ssl\_cert =\> "cert.crt"  
ssl\_key =\> "key.pem"  
ssl\_verify =\> false  
codec =\> json\_lines  
}

I have generated ssl certificate from server using below commands:  
openssl pkcs12 -in pathto\_mykeystore/keystore.p12 -out cert.crt

and key using(it's a private key as I can see it in the output file):  
openssl pkcs12 -in pathto\_mykeystore/keystore.p12 -nocerts -out key.pem

Am I missing something here?  
help/suggestions appreciated

---

<div class="post-metadata">

**Author:** ![mahibabar](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mahibabar](https://discuss.elastic.co/u/mahibabar)\
**Post date:** [June 6, 2018, 5:21am UTC](https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193/2 "2018-06-06T05:21:39Z")

</div>

any inputs here?

---

<div class="post-metadata">

**Author:** ![ceekay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ceekay/32/5687_2.png) [@ceekay](https://discuss.elastic.co/u/ceekay)\
**Post date:** [June 6, 2018, 5:36am UTC](https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193/3 "2018-06-06T05:36:12Z")

</div>

Have you tried a full path to the key/cert pair?

---

<div class="post-metadata">

**Author:** ![mahibabar](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mahibabar](https://discuss.elastic.co/u/mahibabar)\
**Post date:** [June 6, 2018, 6:17am UTC](https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193/4 "2018-06-06T06:17:59Z")

</div>

yes. As paths are internal to product so not mentioned as is.

also tried with `ssl_key_passphrase=<actual_password>`

---

<div class="post-metadata">

**Author:** ![mahibabar](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mahibabar](https://discuss.elastic.co/u/mahibabar)\
**Post date:** [June 8, 2018, 11:54am UTC](https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193/5 "2018-06-08T11:54:31Z")

</div>

@ceekay anything else that I am missing here?  
does logstash support all types of ssl certificate/keys or specific is supported like only X509

---

<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 6, 2018, 11:54am UTC](https://discuss.elastic.co/t/logstash-tcp-output-with-tls-is-not-working/134193/6 "2018-07-06T11:54:31Z")

</div>

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