giraffi / fluent-plugin-amqp

Use AMQP broker to send or receive messages via FluentD
MIT License
15 stars 31 forks source link

enabling tls should not require tls client auth #57

Closed travisghansen closed 5 years ago

travisghansen commented 5 years ago

I run my connections over tls, but don't require client certs. Can the logic be updated to handle this scenario?

ebirn commented 5 years ago

Hi, I think I'm running into the same issue. I want TLS transport plus user/password, but without client certificates. to my understanding, it would require to configure:

however, this seems to cause Bunny amqp lib to crash:

2019-01-28 20:12:17 +0000 [error]: #0 unexpected error error_class=AMQ::Protocol::EmptyResponseError error="Empty response received from the server."
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/amq-protocol-2.3.0/lib/amq/protocol/frame.rb:60:in `decode_header'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/bunny-2.13.0/lib/bunny/transport.rb:243:in `read_next_frame'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/bunny-2.13.0/lib/bunny/session.rb:1144:in `init_connection'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/bunny-2.13.0/lib/bunny/session.rb:314:in `start'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-amqp-0.12.0/lib/fluent/plugin/in_amqp.rb:70:in `start'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/root_agent.rb:165:in `block in start'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/root_agent.rb:154:in `block (2 levels) in lifecycle'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/root_agent.rb:153:in `each'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/root_agent.rb:153:in `block in lifecycle'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/root_agent.rb:140:in `each'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/root_agent.rb:140:in `lifecycle'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/root_agent.rb:164:in `start'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/engine.rb:274:in `start'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/engine.rb:219:in `run'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/supervisor.rb:799:in `run_engine'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/supervisor.rb:549:in `block in run_worker'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/supervisor.rb:724:in `main_process'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/supervisor.rb:544:in `run_worker'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/lib/fluent/command/fluentd.rb:316:in `<top (required)>'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.3.3/bin/fluentd:8:in `<top (required)>'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/bin/fluentd:23:in `load'
  2019-01-28 20:12:17 +0000 [error]: #0 /usr/bin/fluentd:23:in `<main>'
2019-01-28 20:12:17 +0000 [error]: #0 unexpected error error_class=AMQ::Protocol::EmptyResponseError error="Empty response received from the server."
  2019-01-28 20:12:17 +0000 [error]: #0 suppressed same stacktrace
2019-01-28 20:12:17 +0000 [info]: fluent/log.rb:322:info: Worker 0 finished unexpectedly with status 1

I've tried to reproduce the circumstances in a minimal example here: https://gist.github.com/ebirn/62d7c2cdc4104cae6d7932d145b83327

It would seem, that the tls parameter must be nil, otherwise it will abort with the above error.

Best, Erich

sawanoboly commented 5 years ago

@warmfusion If you can spare your time, can you help them? 🙏

warmfusion commented 5 years ago

This should be resolved by https://github.com/giraffi/fluent-plugin-amqp/pull/59 but the test cases are flimsy at best. Given that the code is just removing functionality; ie if its set it works, if it isn't set it doesn't complain anymore, it shouldn't be too problematic to release.