读书人

请大侠们帮助解决ssl vpn环境上的Http

发布时间: 2013-02-28 11:33:09 作者: rapoo

请大侠们帮助解决ssl vpn环境下的HttpWebRequest连不上服务器的问题
有个内部系统,是通过ssl vpn拨通后才可以访问的,现在的问题就是用httpwebrequest访问该站点一直提示无法连接到远程服务器,用webbrowser控件试了也不行,但通过浏览器是可以访问的,请问有什么解决办法么?
网上查了一些东西,比如下面这个
using System.Text.RegularExpressions;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
public bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{ return true; }

然后下面这个就出错了,要求对象引用什么的
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);



[解决办法]
呵呵 正常来说这种问题不会是VPN造成的
话说开发这类项目时兼容性很烦人
不知道你这个以后再其他机器上会不会出事
呵呵

读书人网 >C#

热点推荐