@@ -37,24 +37,24 @@ def test_connect_net_http_base; require 'uri'; require 'net/https'
3737 http = Net ::HTTP . new ( uri . host , uri . port )
3838 http . use_ssl = true
3939 res = http . get ( '/' )
40- # assert_equal '200' , res.code
40+ assert_equal Net :: HTTPOK , res . class
4141 end
4242
4343 def test_connect_net_http_tls12 ; require 'uri' ; require 'net/https'
4444 puts "\n "
4545 puts "------------------------------------------------------------"
46- puts "-- Net::HTTP.new '#{ url = 'https://fancyssl.hboeck.de ' } '"
46+ puts "-- Net::HTTP.new '#{ url = 'https://www.howsmyssl.com/a/check ' } '"
4747 puts "------------------------------------------------------------"
4848
4949 uri = URI . parse ( url )
5050 http = Net ::HTTP . new ( uri . host , uri . port )
5151 http . use_ssl = true
5252 http . ssl_version = :TLSv1_2
53- res = http . get ( '/' )
54- #assert_equal Net::HTTPOK, res.class
53+ res = http . get ( uri . path || '/' , 'Content-Type' => 'application/json' )
54+ assert_equal Net ::HTTPOK , res . class
55+ puts res . body
5556 end
5657
57- # TODO https://www.howsmyssl.com/a/check
5858 def test_connect_net_http_tls13 ; require 'uri' ; require 'net/https'
5959 puts "\n "
6060 puts "------------------------------------------------------------"
@@ -65,8 +65,8 @@ def test_connect_net_http_tls13; require 'uri'; require 'net/https'
6565 http = Net ::HTTP . new ( uri . host , uri . port )
6666 http . use_ssl = true
6767 http . ssl_version = :TLSv1_3
68- res = http . get '/' , 'Accept' => 'application/json' , 'User-Agent' => ''
69- # assert_equal '200', res.code
68+ res = http . get uri . path , 'Accept' => 'application/json' , 'User-Agent' => ''
69+ assert_equal '200' , res . code
7070 puts res . body
7171 end
7272
@@ -110,7 +110,7 @@ def test_connect_net_http_other; require 'uri'; require 'net/https'
110110 http = Net ::HTTP . new ( uri . host , uri . port )
111111 http . use_ssl = true
112112 res = http . get ( '/' )
113- # assert_equal Net::HTTPOK, res.class
113+ assert_equal Net ::HTTPOK , res . class
114114 end
115115
116116 def test_faraday_get ; require 'faraday'
0 commit comments