Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Server Certificates Keyset not found, can't find private key

I have a server certificate working with my WCF service.

However when I run the webservice I seem to have a permissions problem.

[ArgumentException: The certificate 'CN=S80' must have a private key that is capable of key exchange. The process must have access rights for the private key.]

Any idea?

like image 663
AJM Avatar asked Jul 29 '09 12:07

AJM


People also ask

How do I get my certificate private key?

On Windows servers, the OS manages your certificate files for you in a hidden folder, but you can retrieve the private key by exporting a “. pfx” file that contains the certificate(s) and private key. Open Microsoft Management Console (MMC). In the Console Root expand Certificates (Local Computer).

How do I fix the keyset does not exist in Cryptographicexception?

Step 1: Go to folder (C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA). Step 2: Open properties for MachineKeys Folder and go to Security Tab. Step 3: Provide Read & execute and List folder contents permission for IUserand Network Service account.


1 Answers

Assuming you have the full public/private key pair you haven't granted access to the private key of the certificate to the process your WCF service is running under.

Now how you do this depends on your OS version and how you are hosting the service but this article provides instructions that should work in for XP and Windows 2003.

For Windows 2008/Vista/Win7 the process is slightly easier. Start MMC and add the Certificate Snap-in, selecting the right container owner for your SSL certificate. Find the certificate (it's probably in the personal store), right click on it and choose All Tasks > Manage Private key. Grant read access to the private key to the user hosting your service.

like image 98
blowdart Avatar answered Sep 17 '22 18:09

blowdart