TCP input plugin

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:inget_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:inregister_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:ineach'", "/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:instart_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:inrun'", "/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.

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

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

Opened logstash-plugins/logstash-input-tcp#129

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