【发布时间】:2018-12-20 06:38:30
【问题描述】:
我们正在尝试通过 HTTPS 从远程系统访问 java web 服务到我们的 .net 客户端系统。我们面临一个错误:
这可能是由于在 HTTPS 情况下服务器证书未正确配置 HTTP.SYS。这也可能是由于客户端和服务器之间的安全绑定不匹配造成的
有趣的是它在 SOAP UI 中工作,但只有 Visual Studio 的问题。为什么它在肥皂 UI 中而不是在 Visual Studio2010 中工作
protected void Page_Load(object sender, EventArgs e)
{
try
{
ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(CertificationvAlidatefunction);
mainclass.ClientCredentials.UserName.UserName = "testuser";
mainclass.ClientCredentials.UserName.Password = "test123";
response = mainclass.Testmethod(request);
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
private bool CertificationvAlidatefunction(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain, SslPolicyErrors errors)
{
return true;
}
【问题讨论】:
-
哪个是错误?您插入的文本是代码吗? “这可能是由于……”?
-
是的,就是这样,但在 SOAP UI 中工作正常
-
目前添加服务引用,报错
-
您可以访问更新版本的 Visual Studio 吗?
-
不,我没有。我只有 VS 2010