views:

77

answers:

1

Hi,

Question - Is it possible to proxy a HTTPS request using HttpListener & HttpWebRequest? (or is it not possbile due to the encryption?)

I have got a .NET proxy working by using HttpListener & HttpWebRequest using the approach here. I'm trying to extend this at the moment to listen for HTTPS too (refer this question) however I'm wondering if I'm trying to tackle something that is not possible...That is if this code works by listening for the HTTPS request (using HttpListener) and then copying headers & content across to a new HttpWebRequest, is this flawed as it may not be able to decrypt the request to get the content?

But then normal proxy servers obviously can proxy HTTPS, so I guess perhaps it will work because it will just copy across the encrypted content?

+1  A: 

Probably not if the IP address is different. You could try implementing the X-Forwarded-For in the HTTP GET request, but I doubt that would work.

guitar-
But the existing proxy servers (e.g. BIND) must be able to do it without terminating the HTTPS no? I'll try to give X-Forwarded-For a go...
Greg
can't seem to verify this at the moment - I'm hitting the issue/question I've asked at http://stackoverflow.com/questions/2619251/net-httplistener-when-registering-both-http-https-i-get-conflicts-with-an-ex
Greg