SSL / TLS / HTTPS网站都在一个C#/。NET WebBrowser控件在Internet Explorer中很慢,但细 [英] SSL/TLS/HTTPS sites are very slow in a C#/.NET WebBrowser control, but fine in Internet Explorer

查看:1398
本文介绍了SSL / TLS / HTTPS网站都在一个C#/。NET WebBrowser控件在Internet Explorer中很慢,但细的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我修改 AutoWikiBrowser ,提供托管的安全服务器上的MediaWiki站点工作。我允许用户通过在C#应用程序WebBrowser控件手动登录,然后保存所存储的cookie用于HttpWebRequest的的。

I'm modifying AutoWikiBrowser to work with a MediaWiki site hosted on a secure server. I allow the user to login manually via a WebBrowser control in a C# application, and then save the stored cookies for use in HttpWebRequest's.

我遇到的问题是,任何网站,使用SSL / TLS(https://开头的网址)需要一个令人难以置信的长的时间来加载,经常超时。我已经试过这不仅与MediaWiki的网站的问题,也是其他安全的网站,如贝宝和安全的Gmail。

The problem I'm having is that any site which uses SSL/TLS (https:// urls) takes an incredibly long time to load, often timing out. I've tried this not only with the MediaWiki site in question, but also other secure sites like PayPal and secure GMail.

出于好奇,我试图在Visual Studio中,在[VB web浏览器示例] [​​2]的帮助浏览器相同的HTTPS站点,以及[WPF WebBrowser控件示例] [​​3],他们都死了缓慢。这些相同的网站上执行得很好的(当然和Firefox)的Internet Explorer 7。

Out of curiosity I tried the same https sites in the help browser of Visual Studio, the [VB WebBrowser Sample][2], and the [WPF WebBrowser Control Sample][3] and they were all dead slow. These same sites perform just fine in Internet Explorer 7 (and of course Firefox).

什么会导致SSL / TLS网站(HTTPS URL中)是使用.NET WebBrowser控件很慢,但加载精在Internet Explorer?

What would cause SSL/TLS sites (https urls) to be very slow using the .NET WebBrowser control, but load fine in Internet Explorer?

推荐答案

一,我们碰到了为好东西,编码我们的聊天应用程序和Web服务时,是HTTP,SSL类型的要求将需要大量的时间来解决。事实上,当我们在写我们的网站检查(这确保我们所有的网站/服务是在线),将最初为20秒到45秒,只是加载所有的网站.......不是非常有用.NET应用程序。

One of the things we ran into as well, when coding our chat application, and web services, was that HTTP, SSL type request would take a huge amount of time to resolve. In fact, when we were writing our site checker (which ensures all of our sites/services are online), it would initially take 20 seconds to 45 seconds to just load up all the sites.......not very useful in a .NET application.

然而,当我设置了代理为NULL,它装载了几乎瞬间。

However, when I set the Proxy to NULL it loaded up almost instantly.

有时候,你就会有一个错误这样做,寿,这样你就可以做到这一点:

Sometimes you'll have an error doing that tho, so you can do this too:

_api.Proxy = WebRequest.DefaultWebProxy;

不过,我仍然觉得:

But, i still find that:

_api.Proxy = null;

不过最适合大多数Web请求。

Still works best for most web requests.

您也可以强制代理和超时比默认的WinHTTP设置你的app.config内小得多,但指定上述应该做的伎俩为雅。

You could also force the proxy and timeouts to be much smaller than the default WinHTTP settings inside of your app.config, but specifying the above should do the trick for ya.

这篇关于SSL / TLS / HTTPS网站都在一个C#/。NET WebBrowser控件在Internet Explorer中很慢,但细的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆