Ask a Question related to Ruby, Design and Development.
-
Nathaniel Talbott #1
Ruby/OpenSSL bug?
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
<:((><
Nathaniel Talbott Guest
-
[ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
http://ruby-freedb.rubyforge.org/ http://ruby-serialport.rubyforge.org/ http://ruby-mp3info.rubyforge.org/ bye! --... -
Ruby/OpenSSL... bug? [LONG]
Well, there are three variables in this problem now (there were four, but I eliminated DRb), and one of them is broken: 1. OpenSSL 2. Ruby... -
OpenSSL & Ruby 1.8
I'm trying to use the OpenSSL extension included in Ruby 1.8preview6 with DRb, and having difficulty. First of all, the DRb included in Ruby does... -
[Ann] OpenSSL for Ruby 1.0.0
Hello, It's my pleasure to announce that 'OpenSSL for Ruby' reached release version 1.0.0. The biggest news is that it was accepted to Ruby... -
[ANN] OpenSSL for Ruby - 0.2.0-pre3
ossl-0.2.0-pre3 has been released. What's new? few bugfixes some changes of PKCS7 and X509::Store S/MIME handling methods OCSP module Where... -
GOTOU Yuuzou #2
Re: Ruby/OpenSSL bug?
In message <009801c3a8ba$031c5e00$c81e140a@abraham>,
`"Nathaniel Talbott" <nathaniel@NOSPAMtalbott.ws>' wrote:Handshake of SSL needs exchange of some messages, but> The following program hangs indefinitely, blocking the whole script. I would
> expect it to gracefully return an error.
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,
--
gotoyuzo
GOTOU Yuuzou Guest
-
GOTOU Yuuzou #3
Re: Ruby/OpenSSL bug?
In message <20031113.030225.1011599469.gotoyuzo@kotetsu.does. notwork.org>,
`GOTOU Yuuzou <gotoyuzo@notwork.org>' wrote:Though I tried to test it, it didn't work ;)> In message <009801c3a8ba$031c5e00$c81e140a@abraham>,
> `"Nathaniel Talbott" <nathaniel@NOSPAMtalbott.ws>' wrote:>> > 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.
However it enables to interrupt with Crtl-C.
Hmm, I try inspecting a little more.
--
gotoyuzo
GOTOU Yuuzou Guest
-
Nathaniel Talbott #4
Re: Ruby/OpenSSL bug?
GOTOU Yuuzou [mailto:gotoyuzo@notwork.org] wrote:
Bummer. :(> Handshake of SSL needs exchange of some messages, but
> SSLSocket#connect disables switch of thread because it is
> implemented with C.
I don't guess there's a non-blocking version of connect, eh?
Will this allow other threads to run? My problem is that I have a Webrick> 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.
server that needs to check if another site is up, and I don't want the whole
server blocking while it waits on the (possibly nonexistent) reply from the
site.
Thanks for looking in to this,
Nathaniel
<:((><
Nathaniel Talbott Guest



Reply With Quote

