title: help setting up wsHttpBinding WCF service on .net
body: <p>I'm trying to host a WCF service with wsHttpBinding. I created a certificate using makecert and put some lines in web.config. </p>
  
  <p>This is the error that I'm getting:</p>
  
  <pre><code>System.ArgumentException: The certificate 'CN=WCfServer' must have a private key that is capable of key exchange. The process must have access rights for the private key.
  </code></pre>
  
  <p>On googling up it seems to be some issue with access rights on the certificate file. I used cacls to give read permission to NETWORK SERVICE and also my username but it didn't change anything.</p>
  
  <p>I also went to security settings in the properties of the certificate file and gave full control to NETWORK SERVICE and my username. Again to no avail.</p>
  
  <p>Can you guide me as to what the problem is and what exactly I need to do? I'm really flaky with these certificate things.</p>
  
  <p>Here's my web.config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  
  &lt;services&gt;
          &lt;service name="Abc.Service" behaviorConfiguration="Abc.ServiceBehavior"&gt;
              &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="Abc.BindConfig" contract="Abc.IService"&gt;
                  &lt;identity&gt;
                      &lt;dns value="localhost"/&gt;
                  &lt;/identity&gt;
              &lt;/endpoint&gt;
              &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
          &lt;/service&gt;
      &lt;/services&gt;
  
  &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
          &lt;behavior name="Abc.ServiceBehavior"&gt;
              &lt;serviceMetadata httpGetEnabled="true"/&gt;
              &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
  
              &lt;serviceCredentials&gt;
                  &lt;clientCertificate&gt;
                    &lt;authentication certificateValidationMode="PeerTrust"/&gt;
                  &lt;/clientCertificate&gt;
                  &lt;serviceCertificate findValue="WCfServer" storeLocation="CurrentUser" storeName="My" x509FindType="FindBySubjectName" /&gt;
              &lt;/serviceCredentials&gt;
  
          &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  
  &lt;bindings&gt;
    &lt;wsHttpBinding&gt;
      &lt;binding name="Abc.BindConfig"&gt;
        &lt;security mode="Message"&gt;
          &lt;message clientCredentialType="Certificate" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/wsHttpBinding&gt;
  &lt;/bindings&gt;
  
  &lt;/system.serviceModel&gt;
  </code></pre>