Search code examples
c#identityserver4

InvalidOperationException: Key type not specified on AspNetCore using cermgr installed certificate


I'm trying to deploy an AspNetCore app that uses IdentityServer4 to IIS and when I fire it up I get the InvalidOperationException: Key type not specified error. I used the MMC to load certmgr and imported the self signed certificate I created with a password but its not working. Any ideas?


Solution

  • I just had this problem myself. The fix for me was going back into certmgr and right click on the cert, then All Tasks, then Manage Private Keys, and add IIS_IUSRS. Depending on how your IIS app pool is configured for your website you might have to also add user "IIS APPPool{apppoolname}" as well. And for a really old, or misconfigured IIS setup, perhaps Local Service and/or Network Service.