From: Martin Bosslet Date: 2011-10-19T11:15:41+09:00 Subject: [ruby-core:40220] [Ruby 1.9 - Bug #5110][Closed] Ruby SSL error - sslv3 alert unexpected message Issue #5110 has been updated by Martin Bosslet. Status changed from Feedback to Closed If nobody disagrees, I would like to close this. ---------------------------------------- Bug #5110: Ruby SSL error - sslv3 alert unexpected message http://redmine.ruby-lang.org/issues/5110 Author: Michael Hoisie Status: Closed Priority: Normal Assignee: Martin Bosslet Category: ext Target version: 1.9.3 ruby -v: ruby 1.9.2p290 I'm running ruby 1.9.2p290 on a machine with OpenSSL version 0.9.8o 01 Jun 2010 When I run the following script: require 'net/http' url = URI.parse('https://www.xpiron.com/schedule') req = Net::HTTP::Get.new(url.path) sock = Net::HTTP.new(url.host, 443) sock.use_ssl = true sock.start do |http| response = http.request(req) end It generates an error: /usr/local/lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert unexpected message (OpenSSL::SSL::SSLError) from /usr/local/lib/ruby/1.9.1/net/http.rb:678:in `block in connect' from /usr/local/lib/ruby/1.9.1/timeout.rb:44:in `timeout' from /usr/local/lib/ruby/1.9.1/timeout.rb:89:in `timeout' from /usr/local/lib/ruby/1.9.1/net/http.rb:678:in `connect' from /usr/local/lib/ruby/1.9.1/net/http.rb:637:in `do_start' from /usr/local/lib/ruby/1.9.1/net/http.rb:626:in `start' from test.rb:8:in `
' If I add the following line, it works: sock.ssl_version="SSLv3" The HTTPS server seems to be misconfigured, but it may also be an issue with how Ruby's HTTP library negotiates SSL connections. -- http://redmine.ruby-lang.org