有人能告诉我如何创建一个自定义绑定,从WCF中重现以下完全相同的行为吗?

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

我发现的所有Google搜索解决方案似乎都不是出于某种原因而工作。我已经找到了很多关于httpTransport的解决方案,但很少有关于nettcptransport的解决方案。

上面的配置目前正在运行,但我需要修改maxClockSkew,唯一的方法就是使用自定义绑定。

提前致谢, 布赖恩

有帮助吗?

解决方案

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

<binding name="CustomSecureTcp">
    <transactionFlow  />
    <security authenticationMode="SecureConversation"requireSecurityContextCancellation="true">
      <secureConversationBootstrap
        authenticationMode="UserNameOverTransport">
      </secureConversationBootstrap>
    </security>
    <binaryMessageEncoding/>
    <sslStreamSecurity requireClientCertificate="false" />
    <tcpTransport/>
  </binding>
 </customBinding>
编辑:我很确定'transactionProtocol =&quot; OleTransactions&quot;'是不必要的

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top