title: WCF client error “The private key is not present in the X.509 certificate”
body: <p>I'm stuck trying to get a WCF client to communicate to an IIS Hosted WCF Service with TransportWithMessageCredential. </p>
  
  <p>In this scenario we will have about 20 clients all running the client app. It is planned they will all use the same certificate to communicate with our server to provide encryption (identification is handled separately). Our server root web site is already configured with a certificate. The WCF service will be running from a sub-site and I wish to use this same certificate to secure access from our client app to the service. </p>
  
  <p>If I install a PFX certificate on the client everything is fine. But I do not want to export the Private Key from our server - wouldn't this be a security issue?</p>
  
  <p>If I install a CER certificate file, run my client app, I get the error - “The private key is not present in the X.509 certificate” - sounds reasonable as I did not export one</p>
  
  <p>Maybe I'm missing something; I have googled this a lot and most solutions state to export the private key.</p>
  
  <p>Is there any way to use a CER certificate file without exporting the private key from our server? Or what is considered best practice.</p>
  
  <p>Thanks for any advice.</p>