title: why Adding certificate based authentication on rest service hosted as windows service, not able to start service?
body: <p>I have created the WCF REST sevice and hosted as windows service. I took the reference from following post.</p>
  
  <p><a href="http://www.codeproject.com/Tips/1009004/WCF-RESTful-on-Windows-Service-Host" rel="nofollow noreferrer">http://www.codeproject.com/Tips/1009004/WCF-RESTful-on-Windows-Service-Host</a></p>
  
  <p>Now i am trying to add certificate based authentication on it.</p>
  
  <p>I added the following section inside config file.
  note : i followed the following msdn link for adding authetication
  <a href="https://msdn.microsoft.com/en-us/library/ff648360.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/ff648360.aspx</a></p>
  
  <pre><code>&lt;bindings&gt;
    &lt;wsHttpBinding&gt;
      &lt;binding name="wsHttpEndpointBinding"&gt;
        &lt;security&gt;
          &lt;message clientCredentialType="Certificate" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/wsHttpBinding&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code> &lt;serviceBehaviors&gt;
          &lt;behavior name="ServiceBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
            &lt;serviceCredentials&gt;
              &lt;serviceCertificate findValue="CN=tempCertServer" /&gt;
            &lt;/serviceCredentials&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
  </code></pre>
  
  <p>i installed the windows service and when trying to start it. it throws the error.</p>
  
  <p><a href="https://i.stack.imgur.com/mt7kU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mt7kU.png" alt="enter image description here"></a></p>
  
  <p>I removed the following section</p>
  
  <pre><code>&lt;serviceBehaviors&gt;
      &lt;behavior name="ServiceBehavior"&gt;
        &lt;serviceMetadata httpGetEnabled="true" /&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
        &lt;serviceCredentials&gt;
          &lt;serviceCertificate findValue="CN=tempCertServer" /&gt;
        &lt;/serviceCredentials&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  </code></pre>
  
  <p>and error disappear. obviously certification didint work.</p>
  
  <p>What could be the reason?
  am i doing correctly adding certificate based authentication for rest service hosted as windows service?</p>