从现有的 nettcp 绑定在 WCF 中创建自定义绑定

发布于 2024-08-04 18:30:46 字数 576 浏览 4 评论 0原文

谁能告诉我如何创建一个自定义绑定来重现 WCF 中以下内容完全相同的行为?

<netTcpBinding>
        <binding name="SecureTcp" >
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="Certificate" />
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </netTcpBinding>

我发现的所有谷歌解决方案似乎都因某种原因不起作用。我发现了很多关于 httpTransport 的解决方案,但关于 nettcptransport 的解决方案很少。

上述配置当前有效,但我需要修改 maxClockSkew,完成此操作的唯一方法是使用自定义绑定。

提前致谢, 布莱恩

Can anyone tell me how to create a custom binding that reproduces the exact same behavior from the following in WCF?

<netTcpBinding>
        <binding name="SecureTcp" >
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="Certificate" />
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </netTcpBinding>

All of the googled solutions that I've found don't seem to be working for one reason or another. I've found a lot of solutions regarding httpTransport, but very few regarding nettcptransport.

The above configuration is currently working, but I need to modify the maxClockSkew, and the only way to accomplish this is with a custom binding.

Thanks in advance,
Brian

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

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

发布评论

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

评论(1

赏烟花じ飞满天 2024-08-11 18:30:46

嗯,这就是我能想到的。他们的关键是 secureConversationBoostrap 部分中的authenticationMode:

<binding name="CustomSecureTcp">
    <transactionFlow  />
    <security authenticationMode="SecureConversation"requireSecurityContextCancellation="true">
      <secureConversationBootstrap
        authenticationMode="UserNameOverTransport">
      </secureConversationBootstrap>
    </security>
    <binaryMessageEncoding/>
    <sslStreamSecurity requireClientCertificate="false" />
    <tcpTransport/>
  </binding>
 </customBinding>

编辑:我很确定“transactionProtocol =”OleTransactions“”是不必要的

Well, here's what I was able to come up with. They key was the authenticationMode in the secureConversationBoostrap section:

<binding name="CustomSecureTcp">
    <transactionFlow  />
    <security authenticationMode="SecureConversation"requireSecurityContextCancellation="true">
      <secureConversationBootstrap
        authenticationMode="UserNameOverTransport">
      </secureConversationBootstrap>
    </security>
    <binaryMessageEncoding/>
    <sslStreamSecurity requireClientCertificate="false" />
    <tcpTransport/>
  </binding>
 </customBinding>

EDIT: I'm pretty sure that the 'transactionProtocol="OleTransactions"' was unnecessary

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