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

IOError: stream closed on using same Http Object with use_ssl = true with jruby 1.7.19 #2688

Closed
nchhazed opened this issue Mar 12, 2015 · 1 comment
Milestone

Comments

@nchhazed
Copy link

Im using the same Http Object and use the same connection for sending http requests, my code works fine on Ruby but when i use Jruby i get the Following exception:

IOError: stream closed
               close at org/jruby/RubyIO.java:2099
            sysclose at org/jruby/ext/openssl/SSLSocket.java:750
               close at /home/denimuser/.rvm/gems/ruby-2.0.0-p451/gems/jruby-openssl-0.9.6-java/lib/jopenssl19/openssl/buffering.rb:447
               close at /home/denimuser/jruby-1.7.19/lib/ruby/1.9/net/protocol.rb:76
   transport_request at /home/denimuser/jruby-1.7.19/lib/ruby/1.9/net/http.rb:1339
             request at /home/denimuser/jruby-1.7.19/lib/ruby/1.9/net/http.rb:1302
             request at /home/denimuser/jruby-1.7.19/lib/ruby/1.9/net/http.rb:1295
               start at /home/denimuser/jruby-1.7.19/lib/ruby/1.9/net/http.rb:746
             request at /home/denimuser/jruby-1.7.19/lib/ruby/1.9/net/http.rb:1293

Im using the latest Jruby version:

nikhil@client:~/nikhil/client$ jruby -v
jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on OpenJDK 64-Bit Server VM 1.7.0_75-b13 +jit [linux-amd64]

Im suspecting the following code to be culprit, the first request goes out fine but the subsequent fails:

$http = Net::HTTP.new($host, $port)
$http.use_ssl = true
$http.verify_mode = OpenSSL::SSL::VERIFY_NONE
store = OpenSSL::X509::Store.new
store.set_default_paths
$http.cert_store = store

def sendReq(path)
request = Net::HTTP::Get.new(path,initheader = {'Cache-Control' => 'no-cache', 'Connection' => 'keep-alive'})
response = $http.request(request)
return response.code
end
@enebo enebo added this to the Won't Fix milestone May 16, 2017
@enebo
Copy link
Member

enebo commented May 16, 2017

This is pretty old and although there is a code snippet it is not enough for me to easily test 9.x to see if this is a problem there. Please re-open if you find this is broken on 9.x.

@enebo enebo closed this as completed May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants