I am trying to facilitate encrypted SOAP messaging in my WCF service. In order to do this, I have to install and configure a certificate for production. When I use the existing machine certificate, everything works fine. But I don't want to use that certificate, so I created a new one that I got via the Active Directory Certificate Service using the "Web Server" template. When I implemented this certificate in the Web.config, now I receive this error message when attempting to view the WSDL:
Keyset does not exist. It is likely that certificate 'CN=myservice.mydomain.com, O=My Company, L=My City, S=My State' may not have a private key that is capable of key exchange or the process may not have access rights for the private key. Please see inner exception for detail.
I have seen plenty of help responses for this issue, but most of them just assume that I have a permissions issue, or that my cert is in the wrong store, or that my application pool is running under a different account.
Here is a summary of everything I have checked:
Is there something else I need to look at to ensure that my new cert is capable of key exchange?
After much turmoil and hair-pulling, I have finally solved my issue, and now I'm going to share it with you...
First of all, I determined that a lot of the advice on the web regarding this subject is outdated. In my environment at least (IIS 7 and Windows 2008) the web CA interface /certsrv is no longer necessary, and neither is winhttpcertcfg. Both are replaced by the MMC.
In the end, what I had to do was:
I did not find any one article or blog post that provided all this information in one place, I had to cobble it together from six or seven different recommended solutions. Hopefully this serves to save someone else from the headaches I have endured.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With