# TCP input plugin

**URL:** <https://discuss.elastic.co/t/tcp-input-plugin/158016>\
**Category:** Logstash\
**Created:** [November 23, 2018, 1:09pm UTC](https://discuss.elastic.co/t/tcp-input-plugin/158016 "2018-11-23T13:09:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pradeepthota07](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pradeepthota07/32/58695_2.png) [@pradeepthota07](https://discuss.elastic.co/u/pradeepthota07)\
**Post date:** [November 23, 2018, 1:09pm UTC](https://discuss.elastic.co/t/tcp-input-plugin/158016/1 "2018-11-23T13:09:23Z")

</div>

Here is my config for input tcp:

input {  
tcp {  
port =\> 9400  
type =\> "log-tcp"  
add\_field =\> {"parser" =\> "LOGSTASH"}  
ssl\_enable =\> true  
ssl\_cert =\> "/epwf1/ci/logstash/logstash-6.5.1/certs/cert.pem"  
ssl\_key =\> "/epwf1/ci/logstash/logstash-6.5.1/certs/key.pem"  
ssl\_key\_passphrase =\> "123456"  
ssl\_verify =\> false  
}  
}

I get Error registering plugin tcp. Please check the below error.

[2018-11-23T06:01:59,904][ERROR][logstash.pipeline] Pipeline aborted due to error {:pipeline\_id=\>"main", :exception=\>#\<RuntimeError: Could not recognize 'ssl\_key' format. Class: Java::OrgBouncycastlePkcs::PKCS8EncryptedPrivateKeyInfo\>, :backtrace=\>["/epwf1/ci/logstash/logstash-6.5.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-tcp-5.2.0-java/lib/logstash/inputs/tcp/compat\_ssl\_options.rb:84:in `toSslContext'", "/epwf1/ci/logstash/logstash-6.5.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-tcp-5.2.0-java/lib/logstash/inputs/tcp.rb:366:in`get\_ssl\_context'", "/epwf1/ci/logstash/logstash-6.5.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-tcp-5.2.0-java/lib/logstash/inputs/tcp.rb:150:in `register'", "/epwf1/ci/logstash/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:242:in`register\_plugin'", "/epwf1/ci/logstash/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:253:in `block in register_plugins'", "org/jruby/RubyArray.java:1734:in`each'", "/epwf1/ci/logstash/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:253:in `register_plugins'", "/epwf1/ci/logstash/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:396:in`start\_inputs'", "/epwf1/ci/logstash/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:294:in `start_workers'", "/epwf1/ci/logstash/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:200:in`run'", "/epwf1/ci/logstash/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:160:in `block in start'"], :thread=\>"#\<Thread:0x7db5de6f run\>"}

What could be the issue here. Any help is appreciated. thanks.

---

<div class="post-metadata">

**Author:** ![Eniqmatic](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Eniqmatic](https://discuss.elastic.co/u/Eniqmatic)\
**Post date:** [November 23, 2018, 2:56pm UTC](https://discuss.elastic.co/t/tcp-input-plugin/158016/2 "2018-11-23T14:56:14Z")

</div>

Looks like your key file could be in the incorrect format?

---

<div class="post-metadata">

**Author:** ![gunterze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gunterze/32/38011_2.png) [@gunterze](https://discuss.elastic.co/u/gunterze)\
**Post date:** [November 23, 2018, 3:44pm UTC](https://discuss.elastic.co/t/tcp-input-plugin/158016/3 "2018-11-23T15:44:35Z")

</div>

I get the same error after upgrading from logstash-6.4.3 to logstash-6.5.x:

> [2018-11-23T15:40:25,934][ERROR][logstash.pipeline] Error registering plugin {:pipeline\_id=\>"main", :plugin=\>"\<LogStash::Inputs::Tcp codec=\>\<LogStash::Codecs::Frame id=\>"frame\_c76965eb-242f-45a8-a6c2-bcd7de96c1e0", enable\_metric=\>true, charset=\>"UTF-8", delimiter=\>" "\>, ssl\_key=\>"/etc/certs/key.pem", port=\>6514, ssl\_key\_passphrase=\>, ssl\_verify=\>true, ssl\_enable=\>true, id=\>"2b28ea54163e60fe936c36ba2245a165b46881dc3df449d2c6e6eda0e7b20af1", type=\>"audit", ssl\_extra\_chain\_certs=\>["/etc/certs/ca.pem"], ssl\_cert=\>"/etc/certs/cert.pem", enable\_metric=\>true, host=\>"0.0.0.0", mode=\>"server", proxy\_protocol=\>false, tcp\_keep\_alive=\>false, dns\_reverse\_lookup\_enabled=\>true\>", :error=\>"Could not recognize 'ssl\_key' format. Class: Java::OrgBouncycastleOpenssl::PEMEncryptedKeyPair", :thread=\>"#\<Thread:0x4937b4ac run\>"}

May be related with changes applied by pull request [logstash-plugins/logstash-input-tcp#124](https://github.com/logstash-plugins/logstash-input-tcp/pull/124)

Opened [logstash-plugins/logstash-input-tcp#129](https://github.com/logstash-plugins/logstash-input-tcp/issues/129)

---

<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:** [December 21, 2018, 3:44pm UTC](https://discuss.elastic.co/t/tcp-input-plugin/158016/4 "2018-12-21T15:44:38Z")

</div>

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