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

OpenSSL 'connect_nonblock' missing/broken in 1.6.7 and 1.7.0.preview1

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I'm reasonably certain I've filed this before, but can't find it.

      Anyway, OpenSSL::SSL::SSLSocket#connect_nonblock fails on 1.6.7 and is missing on 1.7.0.preview1

      Data: https://gist.github.com/2999123

      Thoughts? I know the 'openssl' lib needs some serious love in terms of api, but I think it's a bug that connect_nonblock was broken in 1.6.7 and is now missing in 1.7.0.

      Happy to try any workarounds! Let me know if you need any more information.

        Activity

        Hide
        Jordan Sissel added a comment -
        % java -jar /Users/jsissel/projects/jruby/lib/jruby-complete.jar --1.9 nonblock.rb
        IOError: Writing not possible during handshake
        

        I'll debug further and try to figure out what's going on.

        Show
        Jordan Sissel added a comment - % java -jar /Users/jsissel/projects/jruby/lib/jruby-complete.jar --1.9 nonblock.rb IOError: Writing not possible during handshake I'll debug further and try to figure out what's going on.
        Hide
        Jordan Sissel added a comment -

        (the above: connect_nonblock is succeeding with no exceptions, but I don't think it's quite right)

        Show
        Jordan Sissel added a comment - (the above: connect_nonblock is succeeding with no exceptions, but I don't think it's quite right)
        Hide
        Jordan Sissel added a comment -
        require "openssl"
        require "socket"
        
        sslcontext = OpenSSL::SSL::SSLContext.new
        sslcontext.ssl_version = "TLSv1"
        
        tcp = TCPSocket.new("twitter.com", 443)
        tls = OpenSSL::SSL::SSLSocket.new(tcp, sslcontext)
        
        tls.connect_nonblock
        tls.connect_nonblock # fails
        

        Run:

        % java -jar /Users/jsissel/projects/jruby/lib/jruby-complete.jar --1.9 x.rb       
        SSLEngineImpl.java:1766:in `setUseClientMode': java.lang.IllegalArgumentException: Cannot change mode after SSL traffic has started
        
        Show
        Jordan Sissel added a comment - require "openssl" require "socket" sslcontext = OpenSSL::SSL::SSLContext.new sslcontext.ssl_version = "TLSv1" tcp = TCPSocket.new("twitter.com", 443) tls = OpenSSL::SSL::SSLSocket.new(tcp, sslcontext) tls.connect_nonblock tls.connect_nonblock # fails Run: % java -jar /Users/jsissel/projects/jruby/lib/jruby-complete.jar --1.9 x.rb SSLEngineImpl.java:1766:in `setUseClientMode': java.lang.IllegalArgumentException: Cannot change mode after SSL traffic has started
        Hide
        Jordan Sissel added a comment -

        If I recall, the remaining issues were easy to fix in the jruby ssl code. I'll see what I can do about fixing these tonight if I get off my butt and hack on it

        Show
        Jordan Sissel added a comment - If I recall, the remaining issues were easy to fix in the jruby ssl code. I'll see what I can do about fixing these tonight if I get off my butt and hack on it
        Hide
        Jordan Sissel added a comment -

        With respect to this ticket, though the 'missing/broken' I reported is fixed. I"ll file a separate ticket if I am able to make connect_nonblock/accept_nonblock execute correctly

        Show
        Jordan Sissel added a comment - With respect to this ticket, though the 'missing/broken' I reported is fixed. I"ll file a separate ticket if I am able to make connect_nonblock/accept_nonblock execute correctly

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Jordan Sissel
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: