giraffi / fluent-plugin-amqp

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

:tls => false hangs connections for some reason #32

Closed mrkurt closed 7 years ago

mrkurt commented 7 years ago
  ssl true$
  tls null$
  verify_ssl false$
  tls_verify_peer false$
  tls_ca_certificates "#{File.read('/rabbit.pem')}

This config hangs the rabbitmq connection (it ultimately times out) when tls: false in the ssl config to Bunny. If tls: nil it works just fine, so this is a tiny patch to do just that.

sawanoboly commented 7 years ago

What version of bunny you're using ? Probably 1.7.1, right ?

sawanoboly commented 7 years ago

hmm... I couldn't realize that why we can't pass false to bunny...

https://github.com/ruby-amqp/bunny/blob/1.7.x-stable/lib/bunny/transport.rb#L304-L308

What do you think? @warmfusion

warmfusion commented 7 years ago

Interesting, if TLS is false, but SSL is true that function will return false(as TLS is checked first) and I suspect the connection hangs due to binding and expecting an insecure protocol and waiting for messages that don't arrive.

I can't review the code at the moment as I'm on holiday without my laptop, but the change seems sensible enough and passes the simple unit tests.

I vote for merging 👍

sawanoboly commented 7 years ago

Ok, thanks!

Pushed fluent-plugin-amqp 0.9.3 to rubygems.org.