gpt4 book ai didi

wcf - 服务器已拒绝客户端凭据

转载 作者:行者123 更新时间:2023-12-03 12:30:13 25 4
gpt4 key购买 nike

我有一个带有 net.tcp 绑定(bind)的 WCF 服务,作为 Windows 服务托管在服务器上。我无法访问此服务。但是,当我将它托管在本地网络上时,我能够这样做。
收到错误

Message:** The server has rejected the client credentials.

Inner Exception:

System.Security.Authentication.InvalidCredentialException:
The server has rejected the client credentials.
---> System.ComponentModel.Win32Exception:
The logon attempt failed --- End of inner exception stack trace
--- at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, ChannelBinding binding, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
尝试搜索解决方案,但没有找到符合我要求的解决方案,因此在此处发布。
可能是什么问题呢?
如果我在客户端将我的安全模式设置为无
<security mode="None"></security>
我得到另一个错误:

Error: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.5149722'.

最佳答案

我刚刚遇到了同样的问题,试图在 DMZ 中获取服务器与我网络内的服务交谈。为我修复它的解决方案是将以下内容添加到 app.config:

注意安全节点。

<bindings>
<netTcpBinding>
<binding name="customTcpBinding" maxReceivedMessageSize="20480000" transferMode="Streamed" >
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>

关于wcf - 服务器已拒绝客户端凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8577612/

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