У меня есть требование, чтобы сертификат x509, который клиент представляет во время сеанса WCF, имел в своей цепочке определенный центр сертификации.
Я знаю, что могу программно проверить цепочку сертификатов с помощью ChainElements [index].
Но я не уверен, как это сделать, все еще интегрируясь с WCF с использованием файлов конфигурации.
В настоящее время WCF настраивается в файле конфигурации, см. Ниже:
<services>
<service name="SampleService" behaviorConfiguration="wsHttpBehavior">
<endpoint name="SampleEndPoint"
address="http://localhost:70000/SampleService.svc"
binding="wsHttpBinding"
bindingConfiguration="wsHttpBinding"
contract="SampleApp.ISampleService">
</endpoint>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding">
<reliableSession enabled="true" ordered="true" />
<security>
<message clientCredentialType="Certificate" />
</security>
</binding>
</wsHittpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<serviceCertificate findValue="aa aa aa"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySerialNumber" />
</serviceCredentials>
<serviceBehaviors>
</behaviors>
Могу ли я что-нибудь сделать в файле конфигурации, чтобы сообщить ему, чтобы предоставленный клиентский сертификат содержал конкретный центр сертификации. Или мне нужно подключиться к каналу WCF для этого? Это вообще возможно?