Merge pull request #92 from khwang1/master

fix the bug in setting http connection's use_ssl option to false.
This commit is contained in:
Marcel Molina 2014-02-19 15:17:07 -08:00
Родитель 22bc35e2f8 1129f68754
Коммит 14bd83cf41
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -98,7 +98,7 @@ module AWS
def create_connection
http = http_class.new(options[:server], options[:port])
http.use_ssl = !options[:use_ssl].nil? || options[:port] == 443
http.use_ssl = options[:use_ssl] || options[:port] == 443
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http
end

Просмотреть файл

@ -15,6 +15,16 @@ class ConnectionTest < Test::Unit::TestCase
connection = Connection.new(keys.merge(:use_ssl => true))
assert connection.http.use_ssl?
end
def test_use_ssl_option_defaults_to_false_in_connection
connection = Connection.new(keys)
assert !connection.http.use_ssl?
end
def test_use_ssl_option_is_set_to_false_in_connection
connection = Connection.new(keys.merge(:use_ssl => false))
assert !connection.http.use_ssl?
end
def test_setting_port_to_443_implies_use_ssl
connection = Connection.new(keys.merge(:port => 443))