日期:2014-05-17  浏览次数:21079 次

请大侠们帮助解决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造成的
话说开发这类项目时兼容性很烦人
不知道你这个以后再其他机器上会不会出事
呵呵