Following the idea of using WebProxy to create an HTTP request to the server by IP address, as shown in the following answers:
Request a web page in C # spoofing a host
Http Request - DNS Bypass [.Net]
I am trying to achieve the same goal with an HTTPS request. I would like to use the HttpWebRequest object to allow the system to automatically control certificate validation.
Unfortunately, this does not work, and I get a System.Net.WebException with the status of WebExceptionStatus.Timeout.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
"https://www.mywebiste.net/"
);
System.Net.WebProxy proxy = new WebProxy(
"192.168.3.14"
, 443
);
request.Proxy = proxy;
WebResponse response = request.GetResponse()
Any help appreciated. TIA.
source
share