尝试在Silverlight应用程序中对HTTPS端点进行Web服务调用会导致此错误:"无法找到与绑定WSHttpBinding的端点的方案https匹配的基址.已注册的基址方案为[http]"
与此处发布的问题相同:
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/4c19271a-f5e6-4659-9e06-b556dbdcaf82/
因此,其中一个建议是:"另一个问题可能是证书名称和机器名称不一致,这导致WCF适合.如果是这种情况,您可以告诉WCF跳过验证证书."
好吧,我确实收到了证书错误,因为这只是一个演示服务器.
以下是我设置客户端的方法:
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;
_ws = new AnnotationService.AnnotationClient(binding, new EndpointAddress(myAddress));
Run Code Online (Sandbox Code Playgroud)
如何告诉WCF跳过验证?
我正在尝试创建一个C#代理DLL,允许VS2015社区在我的离线工作站上通过具有身份验证的公司HTTP代理访问Internet.
按照这篇MSDN博客文章的说明, 我能够以这种方式将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;
}
}
}
Run Code Online (Sandbox Code Playgroud)
但我无法连接到Visual Studio社区访问的帐户身份验证页面.
所以,我正在尝试使用DLL验证Microsoft证书.
我有什么方法可以完成HTTPS和证书问题?
如何验证webProxy DLL中的证书?