wrong argument type Bunny::SSLSocket (expected File) #345

Closed
carlhoerberg opened this Issue Sep 7, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@carlhoerberg
Contributor

carlhoerberg commented Sep 7, 2015

This is sometimes raised when connecting with TLS.

TypeError: wrong argument type Bunny::SSLSocket (expected File)
/app/vendor/bundle/ruby/2.0.0/gems/bunny-2.1.0/lib/bunny/transport.rb:366:in `initialize'
/app/vendor/bundle/ruby/2.0.0/gems/bunny-2.1.0/lib/bunny/transport.rb:366:in `new'
/app/vendor/bundle/ruby/2.0.0/gems/bunny-2.1.0/lib/bunny/transport.rb:366:in `wrap_in_tls_socket'
/app/vendor/bundle/ruby/2.0.0/gems/bunny-2.1.0/lib/bunny/transport.rb:296:in `post_initialize_socket'
/app/vendor/bundle/ruby/2.0.0/gems/bunny-2.1.0/lib/bunny/session.rb:272:in `start'

I believe the problem is that this line is called a second time, when @socket already is a Bunny::SSLSocketImpl instead of a Bunny::Socket as it is the first time (only a Socket is accepted by OpenSSL::SSL::SSLSocket#new).

@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin Sep 7, 2015

Member

@carlhoerberg it can be. The wrap_… function should return its argument if it's already a TLS socket. Feel free to submit a PR :)

Member

michaelklishin commented Sep 7, 2015

@carlhoerberg it can be. The wrap_… function should return its argument if it's already a TLS socket. Feel free to submit a PR :)

carlhoerberg added a commit to carlhoerberg/bunny that referenced this issue Sep 7, 2015

michaelklishin added a commit that referenced this issue Sep 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment