Ruby/OpenSSL bug?

N

Nathaniel Talbott

The following program hangs indefinitely, blocking the whole script. I would
expect it to gracefully return an error.

require 'webrick'
require 'net/https'

s = WEBrick::HTTPServer.new:)Port => 5555)

s.mount_proc("/") do |req, resp|
resp.body = "Hi"
end

t = Thread.new do
s.start
end

h = Net::HTTP.new('localhost', 5555)
h.use_ssl = true
h.head('/')

s.stop
t.join

Note calling #head on an HTTP object pointing at an SSL server does fine.
I'm running:

ruby 1.8.1 (2003-10-31) [i386-linux]

Please let me know if there's any more information I can provide. It would
be great if this could be fixed before the release of 1.8.1.

Thanks,


Nathaniel

<:((><
 
G

GOTOU Yuuzou

In message said:
The following program hangs indefinitely, blocking the whole script. I would
expect it to gracefully return an error.

Handshake of SSL needs exchange of some messages, but
SSLSocket#connect disables switch of thread because it is
implemented with C.

I don't understand whether it is safe to wrap SSL_connect
with TRAP_BEG and TRAP_END. I think that it's better to do
it experimentally after release of Ruby-1.8.1 than now.

regards,
 
G

GOTOU Yuuzou

In message said:
Handshake of SSL needs exchange of some messages, but
SSLSocket#connect disables switch of thread because it is
implemented with C.

I don't understand whether it is safe to wrap SSL_connect
with TRAP_BEG and TRAP_END. I think that it's better to do
it experimentally after release of Ruby-1.8.1 than now.

Though I tried to test it, it didn't work ;)
However it enables to interrupt with Crtl-C.
Hmm, I try inspecting a little more.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top