【问题标题】:Test WCF with Mutual Certificate Authentication using SOAPUI使用 SOAPUI 使用相互证书身份验证测试 WCF
【发布时间】:2020-01-13 12:08:20
【问题描述】:

我正在尝试使用 C# 上的客户端测试具有相互证书身份验证的 WCF 服务,它可以工作;现在我想使用 SOAP UI 测试服务。

这是服务配置:

  <system.serviceModel>
<services>
  <service behaviorConfiguration="ServiceBehavior"  name="WS_XXXXX.WcfXXXX">
    <endpoint address="" 
        binding="customBinding" bindingConfiguration="XXXSoap" bindingNamespace=""
        contract="IXXXSoap" >
    </endpoint>
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:47037/"/>
      </baseAddresses>
    </host>
  </service>
</services>
<bindings>
  <customBinding>
    <binding name="XXXSoap">
      <security authenticationMode="SecureConversation"
                   requireSignatureConfirmation="false"
                   canRenewSecurityContextToken="true"
                   messageProtectionOrder="SignBeforeEncrypt"
                   messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11"
                   requireDerivedKeys="false" >
      <secureConversationBootstrap 
           authenticationMode="MutualCertificate"
           requireSignatureConfirmation="true"
                   canRenewSecurityContextToken="true"
                   messageProtectionOrder="SignBeforeEncrypt"
                   messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11"
                   requireDerivedKeys="false">
      </secureConversationBootstrap>
      </security>
      <textMessageEncoding messageVersion ="Soap11WSAddressingAugust2004"  >
      </textMessageEncoding>
      <httpTransport />
    </binding>
  </customBinding>


</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior" >
      <serviceCredentials>

        <serviceCertificate findValue="WCfClient"
                            storeLocation="CurrentUser"
                            storeName="My"
                            x509FindType="FindBySubjectName" />
      </serviceCredentials>
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

我阅读了一些关于如何在 SOAPUI 上使用服务证书测试 WCF 服务的信息;但由于 WCF 配置(相互证书),我不知道如何配置 SOAP UI 以测试 WCF Web 服务。

提前致谢。

【问题讨论】:

    标签: wcf soapui wshttpbinding mutual-authentication


    【解决方案1】:

    当我们使用相互证书模式来验证客户端并保护服务器通信时。我们需要在客户端和服务器之间建立信任关系,然后在调用服务时在客户端提供客户端证书。对于某些使用消息安全创建的 WCF,我们可能需要在客户端提供服务器端使用的服务证书。
    无论如何,我们至少在客户端有一个客户端证书。在 SOAPUI 中,我们可以为一个请求或所有请求配置客户端证书。
    以下是详细步骤。
    1. 使用导出向导导出您的客户需要提供的证书。

    2. 请勾选“导出私钥”选项。

    3. 输入您的密码。

    4. 为所有请求设置证书。菜单位于主工具栏文件 > 首选项中。

    结果。

    如需发送 https 请求,请参阅以下链接。类似于这些步骤。
    https://www.soapui.org/docs/functional-testing/sending-https-requests.html

    如果问题仍然存在,请随时告诉我。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 2017-03-31
      • 2011-03-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多