views:

28

answers:

0

Following the idea about using a WebProxy to make an http request to a server by IP address as demonstrated in the following answers :

Request Web Page in c# spoofing the Host

Http Request - Bypass DNS [.Net]

I'm trying to achive the same goal with an HTTPS request. I would like to still use an HttpWebRequest object in order to let the system automatically manage the certificate validation.

Unfortunately, this is not working and I get a System.Net.WebException with WebExceptionStatus.Timeout status.

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
    "https://www.mywebiste.net/"
    );
System.Net.WebProxy proxy = new WebProxy(
    "192.168.3.14"
    , 443   // HTTPS
    );
request.Proxy = proxy;
WebResponse response = request.GetResponse()

Any Help appreciated. TIA.