7 class HTTPSProxyTest < Test::Unit::TestCase
8 def test_https_proxy_authentication
10 TCPServer.open("127.0.0.1", 0) {|serv|
11 _, port, _, _ = serv.addr
13 proxy = Net::HTTP.Proxy("127.0.0.1", port, 'user', 'password')
14 http = proxy.new("foo.example.org", 8000)
16 http.verify_mode = OpenSSL::SSL::VERIFY_NONE
23 proxy_request = sock.gets("\r\n\r\n")
25 "CONNECT foo.example.org:8000 HTTP/1.1\r\n" +
26 "Host: foo.example.org:8000\r\n" +
27 "Proxy-Authorization: Basic dXNlcjpwYXNzd29yZA==\r\n" +
36 end if defined?(OpenSSL)