wcf certificate Keyset does not exist problem after reboot

一曲冷凌霜 提交于 2019-12-06 05:48:00

Certificates are pretty difficult from my experience (i'm sure others have strolled through it). Seeing as you've had it working, it seems like you're almost there, so my reccomendations revolve around setting certs up in a different way:

  • Use SelfSSL.exe - available as part of the IIS6.0 resource kit with the following command: SelfSSL.exe /T /N:CN=localhost /V:999 /Q (you can replace localhost with servername). This will create the cert and install it in IIS valid for 999 days.
  • Use winHttpCertCfg - available from Microsoft with the following command: winHTTPCertCfg.exe -g -c local_machine\my -s localhost -a SERVICEACCOUNT (replaceing localhost and SERVICEACCOUNT accordingly) to give the service account you're running it under access to the certs private key.

Let me know if you have any luck!

I solved the issue.
I'm running Vista on my dev box with UAC on. A week or so ago I changed the way I start Visual Studio and apparently I didn't notice that I was working in VS started without an option "Run as administrator". Thats why WcfHost lounched by VS also had limited rights. My bad, I rarely restart VS, it is common practice having a VS running for a week or two with for example unreal3 lunched simultaniosly.

By th way can anyone say will I have problems with access rights for the certificates on a shared hosting(IIS7) with Message security? or shall I target Transport security.

Running as administrator will overwhelm the protections on the certificate, which works. But the solution is to grant the username under which your server is running to the certificate. In the snap-in, right-click the certificate and take all tasks -> manage private keys -> Add a group or user name. For IIS, change the location to your local machine, and the user name is "IIS AppPool/xxxxx" where xxxxx is the name of the IIS application pool in which the application that wants to use the certificate is running. If you get it right the 'check' button will tell you so. I also fumbled through it in IIS Express but don't clearly remember what I did! I had to fire IIS Express up, find it in the task manager, and use the details column to see what username it was under. Hope this helps. Worked for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!