security - WCF service certificate is not in the trusted people store -
i created wcf service should work using certificates. test i’m using self signed certificates works perfect, changes when i’m trying run on server, certificates generates ca. generated client , server certificates using ca, , after exported server certificate “trusted people” folder. (both certificates placed localmachine directory). have granted necessary permissions certificate.
the problem appears when i’m running client program i'm getting exception:
the x.509 certificate cn=xxxx not in trusted people store.
here server config
<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>
here client config
<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>
did know can mistake ?
i don't have lot of wcf experience, generally, want place ca cert in trusted location. client should have own trusted location , ca cert need go there too. , if production service, you'll want change certificatevalidationmode "chaintrust" both client , server, means trust certificates chain ca cert. "peertrust" means place actual cert want trust in trust locations. page may helpful at.
Comments
Post a Comment