我正在尝试customBinding
使用 SOAP 1.2、TLS 和客户端证书创建一个调用 Web 服务。据我了解,这仅适用于customBinding
.
我已经定义了以下行为:
<behaviors>
<endpointBehaviors>
<behavior name="TehRightBehaviour">
<clientCredentials>
<serviceCertificate>
<defaultCertificate findValue="WebInterface" x509FindType="FindBySubjectName" />
<authentication revocationMode="NoCheck" certificateValidationMode="None" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
客户端确实找到了证书,如果我指定了错误的名称,它会引发错误。我的绑定看起来像:
<customBinding>
<binding name="TehRealBinding">
<transactionFlow />
<textMessageEncoding messageVersion="Soap12" />
<security authenticationMode="MutualCertificate" />
<httpsTransport requireClientCertificate="true" />
</binding>
</customBinding>
我把它结合在终点,比如:
<client>
<endpoint address="https://hestia1:8081/cm/main"
behaviorConfiguration="TehRightBehaviour"
binding="customBinding"
bindingConfiguration="TehRealBinding"
contract="BrightMain.CMMainService"
name="cmmain" />
</client>
问题是,如果我调用 Web 服务,它会引发一个异常说
“未提供客户端证书。在 ClientCredentials 中指定客户端证书。”
我发现有几点可以指定证书,显然我用错了。所以我的问题是:哪个是正确的?
在此先感谢,克里斯托夫
Edit: Perhaps, I should learn to read, because specifying the <serviceCertificate>
is obivously not suffictient. I will check this now...