【发布时间】:2017-06-28 16:30:39
【问题描述】:
我正在尝试创建一个 C# 代理 DLL,允许 VS2015 Community 在我的离线工作站上通过具有身份验证的公司 HTTP 代理访问互联网。
按照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 社区。p>
所以,我正在尝试使用 DLL 验证 Microsoft 证书。
有什么方法可以完成 HTTPS 和证书问题?
如何验证 webProxy DLL 中的证书?
【问题讨论】:
标签: c# visual-studio http ssl proxy