Using Net::HTTP to proxy HTTPS

L

Landon Cox

As far as I can tell from my experimenting, there is no way to proxy
HTTPS requests using the Net::HTTP classes. My question is: can it be
done? And if so, how?

I've tried numerous variations, but the main gist of what I've tried is
this code fragment:

httpobj = Net::HTTP.new( host, port )

# this Proxy version below doesn't work to post to an HTTPS url through
a proxy even though
# it's supposed to have
# the same methods as Net::HTTP, errors with a use_ssl is not a method
# httpobj = Net::HTTP.Proxy( @proxy_host, @proxy_port, @proxy_user,
@proxy_password )

httpobj.use_ssl = true

httpobj.start do | http |

request = Net::HTTP::post.new(path)
request.set_form_data({ "scan[scan_results]" => "#{results}" } )
response = http.request(request)

end

Proxying normal HTTP requests works fine. Using HTTPS with no proxying
works fine, but
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top