WCF - 禁用 nettcpbinding 中的安全性 (c#)

发布于 2024-08-30 19:02:14 字数 247 浏览 11 评论 0原文

我正在尝试制作一个自托管的 WCF 应用程序,该应用程序使用 nettcpbinding 但可以在没有域的环境中工作。

它只是两台普通的 Windows 电脑,一台是服务器,另一台是客户端。问题在于,当我尝试让客户端连接时,由于安全设置而被拒绝。

您能否为我指出正确的方向,让我如何让这个场景发挥作用?

我应该(如果可能)禁用安全性吗? 还有另一种(希望是简单的)方法来完成此任务吗?

问候,

丹尼尔

I'm trying to make a self hosted WCF app that uses nettcpbinding but works in an environment without a domain.

It's just two regular windows pc's, one is the server and the other one will be the client. The problem with this is that when I try to get the client to connect it's rejected because of the security settings.

Can you please point me in the right direction as to how I can get this scenario to work?

Should I (if possible) disable security?
Is there another (hopefully simple) way to accomplish this?

Regards,

Daniel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗忘曾经 2024-09-06 19:02:14

如果您想出于测试目的禁用安全性,请在 WCF 项目的 App.config 中将安全性元素更改为 ,例如:

<bindings>
  <netTcpBinding>
    <binding name="netTcpBindingConfig" transferMode="Buffered" maxReceivedMessageSize="5242880">
      <readerQuotas maxArrayLength="5242880" />
      <security mode="None" />
    </binding>
  </netTcpBinding>
</bindings>

如果您有客户端,更新服务引用以同步安全设置。请记住,您应该在生产环境中使用某种级别的安全性。

If you'd like to disable security for testing purposes, in the App.config of the WCF project, change the security element to <security mode="None" />, e.g.:

<bindings>
  <netTcpBinding>
    <binding name="netTcpBindingConfig" transferMode="Buffered" maxReceivedMessageSize="5242880">
      <readerQuotas maxArrayLength="5242880" />
      <security mode="None" />
    </binding>
  </netTcpBinding>
</bindings>

If you have a client, update the service reference to sync the security settings. Keep in mind that you should use some level of security in production environments.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文