开发者

HttpWebRequest to a SSL web site on a server specified by IP address (WebProxy)

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.


Try setting BYPassOnLocal as false. http://msdn.microsoft.com/en-us/library/234s6ee9.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜