【问题标题】:WCF/basicHttp with message security interoperable with Java client?具有可与 Java 客户端互操作的消息安全性的 WCF/basicHttp?
【发布时间】:2014-06-13 11:01:27
【问题描述】:

basicHttp绑定对Java客户端很好用,没有问题,如果我打开消息安全,会不会给Java客户端带来麻烦?

由于basicHttp是SOAP1.1,如果开启消息安全,是否会使用WS-Security来支持基于证书的认证?

【问题讨论】:

    标签: wcf x509


    【解决方案1】:

    如果您想在使用 SOAP 1.1 时使用基于证书的身份验证,最好使用 自定义绑定(还要考虑基于 Java 的客户端或 Oracle 服务等互操作性)。 AuthenticationMode 会根据您的需要而改变。

    例如,下面的绑定显示了服务器端和客户端的相互证书身份验证 + 传输安全性(https)。

    <customBinding>
        <binding name="customSSLMutualCertificate" sendTimeout="00:05:00" receiveTimeout="00:05:00">
          <customTextMessageEncoding messageVersion="Soap11"/>
          <security defaultAlgorithmSuite="Basic256Rsa15" authenticationMode="MutualCertificate"
              requireDerivedKeys="false" securityHeaderLayout="Lax" includeTimestamp="false"
              keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt"
              messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
              requireSignatureConfirmation="false" enableUnsecuredResponse="true">
            <localClientSettings cacheCookies="true" detectReplays="false"
                replayCacheSize="900000" maxClockSkew="00:05:00"
                maxCookieCachingTime="Infinite"
                replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
                sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"
                timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
            <localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00"
                maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
                negotiationTimeout="00:01:00" replayWindow="00:05:00"
                inactivityTimeout="00:02:00"
                sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
                reconnectTransportOnFailure="true" maxPendingSessions="128"
                maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
            <secureConversationBootstrap />
          </security>
          <httpsTransport manualAddressing="false" maxBufferPoolSize="524288"
                       maxReceivedMessageSize="65536" allowCookies="false"
                       authenticationScheme="Anonymous"
                       bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                       keepAliveEnabled="true" maxBufferSize="65536"
                       proxyAuthenticationScheme="Anonymous"
                       realm="" transferMode="Buffered"
                       unsafeConnectionNtlmAuthentication="false"
                       useDefaultWebProxy="true"  requireClientCertificate="false"/>
        </binding>
      </customBinding>
    

    其他选项也请参考Does WCF support WS-Security with SOAP 1.1?

    【讨论】:

    • 谢谢,我知道有这个选项,我已经测试过了,它可以与 .net 客户端一起使用,问题是它是否适用于 Java,就像常规的 basicHttp 绑定一样简单
    • @TOMMYWANG - 正如我指出的,坚持使用自定义绑定进行基于证书的身份验证,其中互操作性是一个问题。上面的自定义绑定配置确实适用于基于 Java 的服务和客户端。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-24
    • 2014-04-24
    • 2011-10-25
    • 2012-02-02
    相关资源
    最近更新 更多