6 options = ARGV.getopts('C:')
8 cert_store = options["C"]
10 uri = URI.parse(ARGV[0])
11 if proxy = ENV['HTTP_PROXY']
12 prx_uri = URI.parse(proxy)
13 prx_host = prx_uri.host
14 prx_port = prx_uri.port
17 h = Net::HTTP.new(uri.host, uri.port, prx_host, prx_port)
18 h.set_debug_output($stderr) if $DEBUG
19 if uri.scheme == "https"
22 if File.directory?(cert_store)
23 h.ca_path = cert_store
25 h.ca_file = cert_store
30 path = uri.path.empty? ? "/" : uri.path
32 STDERR.puts h.peer_cert.inspect if h.peer_cert