我正在尝试创建一个C#代理DLL,允许我的离线工作站上的VS2015社区通过具有身份验证的公司HTTP代理访问Internet。C#Visual Studio 2015:IWebProxy证书验证
继this MSDN blog post指示我能够VisualStudio的连接到HTTP页面以这样的方式
namespace VSProxy
{
public class AuthProxyModule : IWebProxy
{
ICredentials crendential = new NetworkCredential("user", "password");
public ICredentials Credentials
{
get
{
return crendential;
}
set
{
crendential = value;
}
}
public Uri GetProxy(Uri destination)
{
ServicePointManager.ServerCertificateValidationCallback = (Header, Cer, Claim, SslPolicyErrors) => true;
return new Uri("http://128.16.0.123:1234", UriKind.Absolute);
}
public bool IsBypassed(Uri host)
{
return host.IsLoopback;
}
}
}
但我无法连接到该帐户认证页面的Visual Studio社区的访问。
所以,我试图验证使用DLL的Microsoft证书。
有什么办法可以完成HTTPS和证书问题?
如何验证webProxy DLL中的证书?
** warnung:++因为该设置是全局的,所以即使您关闭验证,它也会应用于多线程调用。最好实施特定的主机检查或接受特定的证书指纹。更好的是,将证书安装到Windows证书存储中,以便自动提取证书。 – jessehouwing