証明書を使用して動作する wcf サービスを作成しました。自己署名証明書を使用しているテストは完璧に機能しますが、証明書が CA によって生成されるサーバーで実行しようとすると、すべてが変更されます。CA を使用してクライアント証明書とサーバー証明書を生成し、その後、サーバー証明書を「Trusted people」フォルダーにエクスポートしました。(両方の証明書を LocalMachine ディレクトリに配置しました)。また、証明書に必要なすべての権限を付与しました。
例外が発生しているクライアント プログラムを実行しているときに問題が発生します。
X.509 証明書 CN=xxxx が信頼できるユーザー ストアにありません。
これが私のサーバー構成です
<services>
<service behaviorConfiguration="MyServiceBehavior" name="PoswsService">
<endpoint address="http://xxxx/PoswsService.svc" binding="wsHttpBinding" bindingConfiguration="MyServiceBinding"
contract="IPoswsService" />
<endpoint address="http://xxxx/mex" binding="mexHttpBinding" name="MetadataBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="PeerOrChainTrust" revocationMode="Online"/>
</clientCertificate>
<serviceCertificate findValue="xxxxxxxxxxxxxxxxxxxxx" storeLocation="LocalMachine"
storeName="My" x509FindType="FindBySerialNumber" />
</serviceCredentials>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="MyServiceBinding">
<security>
<message clientCredentialType="Certificate"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
ここにクライアント構成があります
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IPoswsService"
bypassProxyOnLocal="false" transactionFlow="false" >
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Certificate" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://xxxx/PoswsService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IPoswsService"
contract="TestService.IPoswsService" name="WSHttpBinding_IPoswsService" behaviorConfiguration="CustomBehavior">
<identity>
<certificate encodedValue="long word" />
</identity>
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="CustomBehavior">
<clientCredentials>
<clientCertificate findValue="xxxxxxxxxxxxxxxxxxx" x509FindType="FindBySerialNumber" storeLocation="CurrentUser" storeName="My"/>
<serviceCertificate>
<authentication certificateValidationMode="PeerTrust"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
誰かが私の間違いを知っていましたか?