Ask a Question related to Ruby, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. [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! --...
    2. 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...
    3. 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...
    4. [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...
    5. [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...
  3. #2

    Default Re: Ruby/OpenSSL bug?

    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.

    regards,
    --
    gotoyuzo

    GOTOU Yuuzou Guest

  4. #3

    Default Re: Ruby/OpenSSL bug?

    In message <20031113.030225.1011599469.gotoyuzo@kotetsu.does. notwork.org>,
    `GOTOU Yuuzou <gotoyuzo@notwork.org>' wrote:
    > 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.
    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.

    --
    gotoyuzo

    GOTOU Yuuzou Guest

  5. #4

    Default Re: Ruby/OpenSSL bug?

    GOTOU Yuuzou [mailto:gotoyuzo@notwork.org] wrote:
    > Handshake of SSL needs exchange of some messages, but
    > SSLSocket#connect disables switch of thread because it is
    > implemented with C.
    Bummer. :(

    I don't guess there's a non-blocking version of connect, eh?

    > 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.
    Will this allow other threads to run? My problem is that I have a Webrick
    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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139