2

Issue: Net::HTTP calls failing when using jruby with a OpenSSL::SSLError Socket Closed, but working fine using MRI.

Side Note: Calls to many servers work, however this app is calling to a cisco sensor. Again, it works via MRI but not Jruby. I've tried a number of different things to no avail. I've tried jruby 1.6.7, 1.7, and the recently released 1.7.1.dev. I've also tried jruby-openssl-0.7.4, 0.7.7, and 0.8.0.pre3. I've even tried running the script with from Ruby 1.8, and 1.9.

Failing At https://github.com/jruby/jruby/blob/master/src/org/jruby/ext/openssl/SSLSocket.java#L404 ?

Similar Issue in research: http://jira.codehaus.org/browse/JRUBY-6346

Small Back Trace Excerpt

org/jruby/ext/openssl/Utils.java:79:in newError'
org/jruby/ext/openssl/SSL.java:92:innewSSLError'
org/jruby/ext/openssl/SSLSocket.java:192:in connectCommon'
org/jruby/ext/openssl/SSLSocket.java:162:inconnect'
org/jruby/runtime/callsite/CachingCallSite.java:306:in cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:136:incall'
org/jruby/ast/CallNoArgNode.java:64:in interpret'
org/jruby/ast/NewlineNode.java:105:ininterpret'

I have scoured google with no luck. Any help would be greatly appreciated.

It should also be noted that I am running OSX Mountain Lion 10.8.2.

[UPDATE]

I have ran out of time to debug this and used the following workaround: Gemfile

gem 'typhoeus'

Test method

def send_post(url, body)
  response  = Typhoeus::Request.post(url,
    :method => :post,
    :disable_ssl_host_verification => true,
    :disable_ssl_peer_verification => true,
    :username => @auth[:username],
    :password => @auth[:password],
    :headers => {
      'Accept' => 'text/xml',
      'Content-type' => 'application/binary',
      'Connection' => 'keepalive',
      'Accept-Charset' => 'iso-8859-1,*,utf-8',
      'Pragma' => 'no-cache',
      'Cache-Control' => 'no-cache',
    },
    :body => body
  )
  response
end
4

0 回答 0