Project

General

Profile

Bug #14013 ยป webrick_60172_fix.patch

MSP-Greg (Greg L), 10/14/2017 03:33 AM

View differences:

lib/webrick/server.rb
295 295
          end
296 296
          if sock.respond_to?(:sync_close=) && @config[:SSLStartImmediately]
297 297
            WEBrick::Utils.timeout(@config[:RequestTimeout]) do
298
              sock.accept # OpenSSL::SSL::SSLSocket#accept
298
              ret = sock.accept_nonblock(exception: false)
299
              case ret
300
              when :wait_readable
301
                t = IO.select([sock.to_io])
302
                t.is_a?(Array) ? t[0] : nil
303
              when :wait_writeable
304
                t = IO.select(nil, [sock.to_io])
305
                t.is_a?(Array) ? t[0] : nil
306
              else
307
                ret
308
              end
299 309
            end
300 310
          end
301 311
          call_callback(:AcceptCallback, sock)
test/net/http/test_https.rb
116 116
    skip $!
117 117
  end
118 118

  
119
  if ENV["RUBY_OPENSSL_TEST_ALL"]
120
    def test_verify
121
      http = Net::HTTP.new("ssl.netlab.jp", 443)
122
      http.use_ssl = true
123
      assert(
124
        (http.request_head("/"){|res| } rescue false),
125
        "The system may not have default CA certificate store."
126
      )
127
    end
119
  def test_verify
120
    skip("No cert file file found.") unless
121
      File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE ||'') || 
122
      File.exist?(ENV['SSL_CERT_FILE'] || '')
123
    http = Net::HTTP.new("ssl.netlab.jp", 443)
124
    http.use_ssl = true
125
    assert(
126
      (http.request_head("/"){|res| } rescue false),
127
      "The system may not have default CA certificate store."
128
    )
128 129
  end
129 130

  
130 131
  def test_verify_none