summaryrefslogtreecommitdiff
path: root/bin/run_tests
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-06-22 13:42:04 -0700
committerelijah <elijah@riseup.net>2014-06-22 13:42:04 -0700
commitc20aa4f8c35a4cba982de92105da2566ecdfa1ae (patch)
tree98721d13231bd50925865b25975e0c8371529d38 /bin/run_tests
parent897815dc5a3a058b3210b76eb74a3dfae9b9165c (diff)
run_tests: allow for https in assert_get()
Diffstat (limited to 'bin/run_tests')
-rwxr-xr-xbin/run_tests17
1 files changed, 12 insertions, 5 deletions
diff --git a/bin/run_tests b/bin/run_tests
index 526aa83a..3ba89684 100755
--- a/bin/run_tests
+++ b/bin/run_tests
@@ -127,11 +127,18 @@ class LeapTest < MiniTest::Unit::TestCase
if params
uri.query = URI.encode_www_form(params)
end
- response = Net::HTTP.get_response(uri)
- if response.is_a?(Net::HTTPSuccess)
- yield response.body, response, nil
- else
- yield nil, response, nil
+ http = Net::HTTP.new uri.host, uri.port
+ if uri.scheme == 'https'
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ http.use_ssl = true
+ end
+ http.start do |agent|
+ response = agent.get(uri.request_uri)
+ if response.is_a?(Net::HTTPSuccess)
+ yield response.body, response, nil
+ else
+ yield nil, response, nil
+ end
end
rescue => exc
yield nil, nil, exc