JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-5529

[1.9] undefined method `read_nonblock' for #<OpenSSL::SSL::SSLSocket:0x246adb31> (NoMethodError)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: JRuby-OSSL 0.7.3
    • Fix Version/s: JRuby 1.7.1
    • Component/s: OpenSSL, Ruby 1.9.2, Ruby 1.9.3
    • Labels:
      None
    • Environment:
    • Number of attachments :
      1

      Description

      /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/bin/jruby --1.9 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/vsrikarunyan/workspace/mine/lab/linkedin.rb
      /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/protocol.rb:135:in `rbuf_fill': undefined method `read_nonblock' for #<OpenSSL::SSL::SSLSocket:0x246adb31> (NoMethodError)
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/protocol.rb:116:in `readuntil'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/protocol.rb:126:in `readline'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/http.rb:2211:in `read_status_line'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/http.rb:2200:in `read_new'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/http.rb:1183:in `transport_request'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/http.rb:1169:in `request'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/http.rb:1162:in `request'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/http.rb:627:in `start'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/1.9/net/http.rb:1160:in `request'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/gems/1.8/gems/oauth-0.4.4/lib/oauth/consumer.rb:164:in `request'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/gems/1.8/gems/oauth-0.4.4/lib/oauth/consumer.rb:197:in `token_request'
      from /app/jruby/JRuby.Framwork/Versions/1.6.0.RC2/lib/ruby/gems/1.8/gems/oauth-0.4.4/lib/oauth/consumer.rb:139:in `get_request_token'
      from /Users/vsrikarunyan/workspace/mine/lab/linkedin.rb:21:in `(root)'
      from org/jruby/RubyKernel.java:1073:in `load19'
      from -e:1:in `(root)'

      Process finished with exit code 1

        Issue Links

          Activity

          Hide
          Charles Oliver Nutter added a comment -

          Ok, with the above commit and one additional, I'm able to run the read_nonblock test from test_ssl (along with a few others) and I'd really like to say we're good here now.

          commit f3c7847e16f5ce026d96be4259cf4e41034c51bf
          Author: Charles Oliver Nutter <headius@headius.com>
          Date:   Wed Oct 24 14:51:28 2012 -0500
          
              More fixes for SSLSocket.
              
              * Treat TCPServer#shutdown as unsupported by raising ENOTCONN
              * Unmask several test_ssl tests that pass now.
          
          :100644 100644 de79e18... 9520b70... M	src/org/jruby/ext/socket/RubyTCPServer.java
          :100644 100644 55c1485... 34411ac... M	test/externals/ruby1.9/excludes/OpenSSL/TestSSL.rb
          
          commit b4af8a56aea8d3b8031bef7fdd364565e543f491
          Author: Charles Oliver Nutter <headius@headius.com>
          Date:   Wed Oct 24 13:12:45 2012 -0500
          
              Fix read_nonblock to actually attempt the read, rather than raise.
          
          :100644 100644 7c175fc... 47d3ec3... M	src/org/jruby/ext/openssl/SSLSocket.java
          
          Show
          Charles Oliver Nutter added a comment - Ok, with the above commit and one additional, I'm able to run the read_nonblock test from test_ssl (along with a few others) and I'd really like to say we're good here now. commit f3c7847e16f5ce026d96be4259cf4e41034c51bf Author: Charles Oliver Nutter <headius@headius.com> Date: Wed Oct 24 14:51:28 2012 -0500 More fixes for SSLSocket. * Treat TCPServer#shutdown as unsupported by raising ENOTCONN * Unmask several test_ssl tests that pass now. :100644 100644 de79e18... 9520b70... M src/org/jruby/ext/socket/RubyTCPServer.java :100644 100644 55c1485... 34411ac... M test/externals/ruby1.9/excludes/OpenSSL/TestSSL.rb commit b4af8a56aea8d3b8031bef7fdd364565e543f491 Author: Charles Oliver Nutter <headius@headius.com> Date: Wed Oct 24 13:12:45 2012 -0500 Fix read_nonblock to actually attempt the read, rather than raise. :100644 100644 7c175fc... 47d3ec3... M src/org/jruby/ext/openssl/SSLSocket.java
          Hide
          Matt Hauck added a comment -

          What about for writing? Not sure if this got lost in the conversation, but cf. my previous suggested implementation: https://github.com/matthauck/jruby-ossl/commit/154d6b316867af142d7aedba997b286ecf5506e8

          Show
          Matt Hauck added a comment - What about for writing? Not sure if this got lost in the conversation, but cf. my previous suggested implementation: https://github.com/matthauck/jruby-ossl/commit/154d6b316867af142d7aedba997b286ecf5506e8
          Hide
          Charles Oliver Nutter added a comment -

          Matt: Your logic looks sound. I probably just missed it in previous conversations. I'll look at getting it (or a form of it) incorporated.

          Show
          Charles Oliver Nutter added a comment - Matt: Your logic looks sound. I probably just missed it in previous conversations. I'll look at getting it (or a form of it) incorporated.
          Hide
          Charles Oliver Nutter added a comment -

          My earlier commits did half of what yours does, and then the following two commits incorporate your additional changes plus some tweaks to allow interrupting read/write threads.

          commit d7deae6aa78797515bcc86223b8e0fa1a1537272
          Author: Charles Oliver Nutter <headius@headius.com>
          Date:   Wed Oct 24 19:44:03 2012 -0500
          
              Tweaks to previous commit to support interrupting blocked threads.
          
          :100644 100644 da88636... c095582... M	src/org/jruby/ext/openssl/SSLSocket.java
          
          commit 70921f420e6bb1baefbb32c2734eae108fc62e19
          Author: Charles Oliver Nutter <headius@headius.com>
          Date:   Wed Oct 24 19:24:39 2012 -0500
          
              Incorporate Matt Hauck's SSLSocket nonblock read/write cleanups.
          
          :100644 100644 ec64ed2... da88636... M	src/org/jruby/ext/openssl/SSLSocket.java
          
          Show
          Charles Oliver Nutter added a comment - My earlier commits did half of what yours does, and then the following two commits incorporate your additional changes plus some tweaks to allow interrupting read/write threads. commit d7deae6aa78797515bcc86223b8e0fa1a1537272 Author: Charles Oliver Nutter <headius@headius.com> Date: Wed Oct 24 19:44:03 2012 -0500 Tweaks to previous commit to support interrupting blocked threads. :100644 100644 da88636... c095582... M src/org/jruby/ext/openssl/SSLSocket.java commit 70921f420e6bb1baefbb32c2734eae108fc62e19 Author: Charles Oliver Nutter <headius@headius.com> Date: Wed Oct 24 19:24:39 2012 -0500 Incorporate Matt Hauck's SSLSocket nonblock read/write cleanups. :100644 100644 ec64ed2... da88636... M src/org/jruby/ext/openssl/SSLSocket.java
          Hide
          Matt Hauck added a comment -

          Sweet. Thanks. =)

          Show
          Matt Hauck added a comment - Sweet. Thanks. =)

            People

            • Assignee:
              Charles Oliver Nutter
              Reporter:
              Venkateshwaralu Srikarunyan
            • Votes:
              17 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: