gpt4 book ai didi

wcf - 系统.ServiceModel.Security.SecurityNegotiationException : Could not establish trust relationship for the SSL/TLS secure channel with authority

转载 作者:太空宇宙 更新时间:2023-11-03 13:01:36 25 4
gpt4 key购买 nike

我在尝试通过 UAT 环境调用网络服务时出现以下错误。但是在我的本地它工作正常。我看到一些评论,因为它可能是由于虚拟证书引起的,但无法得到答案,因此将其张贴在这里。我也是 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: 根据验证程序,远程证书无效。

绑定(bind)是

  <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>

也想知道它在我的本地主机上是如何工作的。

最佳答案

可以引用这篇帖子here .如帖子中所述,如果您信任带有 SSL 的 URL,或者如果所有组件都托管在您公司的内部网中,则在证书验证中始终返回 True 是安全的。

关于wcf - 系统.ServiceModel.Security.SecurityNegotiationException : Could not establish trust relationship for the SSL/TLS secure channel with authority,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15750575/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com