i newbie web services please bear me.i have working wcf restful service hosted on localhost. want add security service. have come know can add x.509 certificates service , jquery client. , have created certificates using makecert.exe following this tutorial.
i have added certificates web.config file depicted in tutorial service doed not ask certificate jquery client. responds data. want service respond when gets certificate jquery client.
i can see certificates listed under mmc console's trusted people panel.
here configuration part of service
<system.servicemodel> <services> <service name="restdemo.restdemo" behaviorconfiguration="servicebehavior"> <host> <baseaddresses> <add baseaddress="https://localhost/restdemo/restdemo.svc"/> </baseaddresses> </host> <endpoint address="https://localhost/restdemo/restdemo.svc" binding="webhttpbinding" contract="restdemo.irestdemo" behaviorconfiguration="web"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexhttpsbinding" contract="restdemo.irestdemo" /> </service> </services> <bindings> <webhttpbinding> <binding name="web"> <security mode="transport"> <transport clientcredentialtype="certificate"/> </security> </binding> </webhttpbinding> </bindings> <behaviors> <servicebehaviors> <behavior name="servicebehavior"> <servicecredentials> <clientcertificate> <authentication certificatevalidationmode="peertrust"/> </clientcertificate> <servicecertificate findvalue="wcfserver" storelocation="currentuser" storename="my" x509findtype="findbysubjectname" /> </servicecredentials> <!-- avoid disclosing metadata information, set values below false before deployment --> <servicemetadata httpgetenabled="false" httpsgetenabled="true" /> <!-- receive exception details in faults debugging purposes, set value below true. set false before deployment avoid disclosing exception information --> <servicedebug includeexceptiondetailinfaults="false"/> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="web"> <webhttp/> </behavior> </endpointbehaviors> </behaviors> <protocolmapping> <add binding="basichttpsbinding" scheme="https" /> </protocolmapping> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> </system.servicemodel> even after adding certificates in web.config service returns data tot client. i running both service , client on same machine.
what doing wrong here?
- install certificates
- configure port ssl certificate
- configure wcf service
for details see ssl self-hosted wcf service
Comments
Post a Comment