Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
carlhoerberg opened this issue Sep 7, 2015 · 1 comment · Fixed by #346
Closed

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

carlhoerberg opened this issue Sep 7, 2015 · 1 comment · Fixed by #346

Comments

@carlhoerberg
Copy link
Contributor

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
Copy link
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 :)

carlhoerberg added a commit to carlhoerberg/bunny that referenced this issue Sep 7, 2015
michaelklishin pushed 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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants