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

SSLSocket#connect_nonblock raises WaitReadable in JRuby, WaitWritable in MRI #1716

Closed
iconara opened this issue May 26, 2014 · 0 comments
Closed

Comments

@iconara
Copy link
Contributor

iconara commented May 26, 2014

SSLSocket#connect_nonblock raises an error that is-a IO::WaitReadable in JRuby, but in MRI it is instead IO::WaitWritable:

require 'socket'
require 'openssl'

socket = OpenSSL::SSL::SSLSocket.new(Socket.new(:INET, :STREAM))

begin
  socket.connect_nonblock
rescue => e
  puts("#{RUBY_ENGINE} WaitReadable #{e.is_a?(IO::WaitReadable)}")
  puts("#{RUBY_ENGINE} WaitWritable #{e.is_a?(IO::WaitWritable)}")
end

running this shows the mismatch:

$ rvm use jruby-1.7.12,ruby-2.0.0-p353 do ruby bug.rb
jruby-1.7.12: jruby 1.7.12 (1.9.3p392) 2014-04-15 643e292 on Java HotSpot(TM) 64-Bit Server VM 1.8.0-b132 +indy [darwin-x86_64]
jruby WaitReadable true
jruby WaitWritable false
ruby-2.0.0-p353: ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin12.5.0]
ruby WaitReadable false
ruby WaitWritable true

I'm not sure what's right here. To me a connect is a read, so WaitReadable does seem to be what I expect – but MRI is the reference implementation I guess.

iconara added a commit to iconara/ione that referenced this issue May 26, 2014
iconara added a commit to iconara/ione that referenced this issue Sep 5, 2014
iconara added a commit to iconara/ione that referenced this issue Sep 8, 2014
iconara added a commit to iconara/ione that referenced this issue Sep 8, 2014
kares added a commit to jruby/jruby-openssl that referenced this issue Jan 18, 2017
@kares kares closed this as completed Jan 18, 2017
@kares kares added this to the Invalid or Duplicate milestone Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants