I have created the WCF REST sevice and hosted as windows service. I took the reference from following post.
http://www.codeproject.com/Tips/1009004/WCF-RESTful-on-Windows-Service-Host
Now i am trying to add certificate based authentication on it.
I added the following section inside config file. note : i followed the following msdn link for adding authetication https://msdn.microsoft.com/en-us/library/ff648360.aspx
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndpointBinding">
<security>
<message clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
</bindings>
and
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<serviceCertificate findValue="CN=tempCertServer" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
i installed the windows service and when trying to start it. it throws the error.
I removed the following section
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<serviceCertificate findValue="CN=tempCertServer" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
and error disappear. obviously certification didint work.
What could be the reason? am i doing correctly adding certificate based authentication for rest service hosted as windows service?