File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'httpclient' , :require => false
Original file line number Diff line number Diff line change
1
+ # coding: US-ASCII
2
+ require File . expand_path ( '../ruby/test_helper' , File . dirname ( __FILE__ ) )
3
+
4
+ class IntegrationSSLTest < TestCase
5
+
6
+ def test_connect_http_client_1
7
+ require 'httpclient'
8
+
9
+ puts "\n "
10
+ puts "------------------------------------------------------------"
11
+ puts "-- HTTPClient.new.get 'https://www.bankofamerica.com'"
12
+ puts "------------------------------------------------------------"
13
+ puts HTTPClient . new . get ( 'https://www.bankofamerica.com' )
14
+ end
15
+
16
+ def test_connect_http_client_2
17
+ require 'httpclient'
18
+
19
+ puts "\n "
20
+ puts "------------------------------------------------------------"
21
+ puts "-- HTTPClient.new.get 'https://google.co.uk'"
22
+ puts "------------------------------------------------------------"
23
+ puts HTTPClient . new . get ( 'https://google.co.uk' )
24
+ end
25
+
26
+ def test_connect_net_http_1
27
+ require 'uri' ; require 'net/https'
28
+
29
+ puts "\n "
30
+ puts "------------------------------------------------------------"
31
+ puts "-- Net::HTTP.new ... 'https://rubygems.org'"
32
+ puts "------------------------------------------------------------"
33
+
34
+ uri = URI . parse ( 'https://rubygems.org' )
35
+
36
+ http = Net ::HTTP . new ( uri . host , uri . port )
37
+ http . use_ssl = true
38
+ puts http . get ( '/' )
39
+ end
40
+
41
+ end
You can’t perform that action at this time.
0 commit comments