我們正在構建一個C++/WWSAPI客戶端以連接第三方C#/。net服務器。我們有一個與服務器一起工作的示例C#/ .net客戶端。它有這個在它的App.config中(client.exe.config):與App.config中的C#/。net <serviceCertificate>等效的WWSAPI
<behaviors>
<endpointBehaviors>
<behavior name="TheirBehavior">
<clientCredentials>
<serviceCertificate>
<defaultCertificate findValue="crypt.theirdomain.com" storeLocation="LocalMachine" storeName="Root" x509FindType="FindBySubjectName"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="https://zzz.theirdomain.com/TheirService.svc"
binding="customBinding" bindingConfiguration="TheirServiceBinding" behaviorConfiguration="TheirBehavior"
contract="ProdWS.ITheirService" name="TheirServiceBinding">
<identity>
<dns value="crypt.theirdomain.com"/>
</identity>
</endpoint>
</client>
我們也有一個證書,我們正在正確加載它(否則我們呼叫之前得到There was an error when trying to find certificate '...'; Cannot find object or property.
)
如何我們是否在WWSAPI中啓用此功能?是否有任何參考將顯示所有.net配置設置和相應的WWSAPI配置之間的映射?
下面的配置(WS_SECURITY_BINDING
設定)給出Invalid certificate credential specification in security binding.
:
WS_SSL_TRANSPORT_SECURITY_BINDING sslBind{};
sslBind.binding.bindingType = WS_SSL_TRANSPORT_SECURITY_BINDING_TYPE;
sslBind.localCertCredential = &certCred.credential;
這是在正確的軌道上?