【发布时间】:2013-03-22 22:45:40
【问题描述】:
我在尝试通过 UAT 环境调用 web 服务时遇到错误。但是在我的本地它工作正常。我看到一些评论,因为它可能是由于虚拟证书,但无法得到答案,所以在这里发布。我也是 WCF 的初学者。 请让我知道我该如何解决这个问题。
如果我完全信任的话会对生产产生什么影响
//Trust all certificates
System.Net.ServicePointManager.ServerCertificateValidationCallback =
((sender, certificate, chain, sslPolicyErrors) => true);
错误说 - System.ServiceModel.Security.SecurityNegotiationException: 无法为具有权限的 SSL/TLS 安全通道建立信任关系。 ---> System.Net.WebException:底层连接已关闭:无法为 SSL/TLS 安全通道建立信任关系。 ---> System.Security.Authentication.AuthenticationException: 根据验证程序,远程证书无效。
绑定是
<basicHttpBinding>
<binding name="GLEditServiceSOAP" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
还想知道它在我的本地主机上是如何工作的。
【问题讨论】:
-
您是否尝试将服务器的证书添加到受信任的证书存储中?