我们正在构建一个 C++/WWSAPI 客户端来连接第三方 C#/.net 服务器。我们有一个与服务器一起使用的示例 C#/.net 客户端。它的 App.config (client.exe.config) 中有这个:
<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;
这是在正确的轨道上吗?