Thursday, July 14, 2016

Keyset does not exist

Problem:

I have some code that makes a call to an external web service that is secured using X.509 certification.  If I call the service using the application pool set to Local service then it executes.


When I set the app pool to use a domain account domain\svc.account the webservice fails with the error: Keyset does not exist.


Solution:

This certificate is installed correctly but the domain account needs to be granted permissions to that certificate.  This will allow the service account to access the private key attached to the certificate.


  1. Start -> Run -> MMC
  2. File -> Add/Remove Snapin
  3. Add the Certificates Snap In
  4. Select Computer Account, then hit next
  5. Select Local Computer (the default), then click Finish
  6. On the left panel from Console Root, navigate to Certificates (Local Computer) -> Personal -> Certificates
  7. Your certificate will most likely be here.
  8. Right click on your certificate -> All Tasks -> Manage Private Keys



       9.Add you service account to the access list.  It will need a minimum of read permissions.




      10.It is possible that you may be required to add the local IIS_USRS group to the access list.  Grant it read permissions.

Source

No comments:

Post a Comment