Riz*_*ban 5 azure .net-core identityserver4
我在将IdentityServer 4(ASP.NET Core 1.1)部署到Azure VM(Windows Server 2012 R2)时遇到此证书问题.
crit: IdentityServer4.Hosting.IdentityServerMiddleware[0]
Unhandled exception: Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: The system cannot find the file specified
at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider, CngKeyOpenOptions openOptions)
at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider)
at Internal.Cryptography.Pal.CertificatePal.GetPrivateKey[T](Func`2 createCsp, Func`2 createCng)
at Internal.Cryptography.Pal.CertificatePal.GetRSAPrivateKey()
Run Code Online (Sandbox Code Playgroud)
这将适用于本地开发计算机,我无法弄明白为什么.我在VM上的My(本地计算机)存储上安装了证书.
任何人都可以帮助这个.谢谢.
我在这里找到了解决方案:
显然,我需要在应用程序池上启用加载用户配置文件.但是,错误现在更改为:
crit: IdentityServer4.Hosting.IdentityServerMiddleware[0]
Unhandled exception: Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Keyset does not exist
at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider, CngKeyOpenOptions openOptions)
at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider)
at Internal.Cryptography.Pal.CertificatePal.GetPrivateKey[T](Func`2 createCsp, Func`2 createCng)
at Internal.Cryptography.Pal.CertificatePal.GetRSAPrivateKey()
Run Code Online (Sandbox Code Playgroud)
现在看看这个问题.
好的,所以问题是阅读证书的许可.我们只需要转到证书并为IIS_IUSRS 授予Read(仅限).
现在它有效.
如果有人想知道如何让 IIS 用户访问证书
基于此,IIS 7.5 应用程序池的标识使用以下之一。
IIS AppPool\AppPoolName并授予它Full control。将“ AppPoolName ”替换为您的应用程序池的名称(有时IIS_IUSRS)以上摘自这里。
| 归档时间: |
|
| 查看次数: |
2597 次 |
| 最近记录: |