Visual Studio 2017给出``将证书添加到受信任的根证书存储失败,并显示以下错误'' [英] Visual Studio 2017 gives 'Adding the Certificate to The Trusted Root Certificates store failed with the following Errror'

查看:513
本文介绍了Visual Studio 2017给出``将证书添加到受信任的根证书存储失败,并显示以下错误''的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将SSL模式设置为true来运行ASP MVC应用程序,并且每当我运行该应用程序时,都会提示我信任IIS Express SSL证书.单击是"后,将显示错误消息将证书添加到受信任的根证书存储失败,并显示以下错误".访问被拒绝'.我正在以管理员模式运行Visual Studio 2017.我还通过转到MMC删除了本地主机证书. 有没有其他人遇到这个问题.

I am trying to run ASP MVC application with SSL mode set to true and whenever i run the application, i get prompt to trust the IIS Express SSL certificate. Upon clicking Yes, it gives the error message 'Adding the Certificate to The Trusted Root Certificates store failed with the following Errror. Access is denied'. I am running my Visual Studio 2017 as administrator mode. I have also deleted localhost certificate by going to MMC. Has anyone else run into this issue.

SOLN:这对我有用. 删除了所有本地主机证书.在添加/删除程序"中修复了IIS Express.将本地主机证书从个人/证书"复制并粘贴到受信任的根证书",并且不再抱怨.

SOLN: This is what worked for me. deleted all localhost certificates. ran repair IIS Express in Add/Remove Programs. Copy and pasted localhost certificate from Personal/Certificate to Trusted Root Certificates and it didn't complain anymore.

推荐答案

注意:从问题中添加OP的解决方案作为答案.

这对我有用.删除了所有本地主机证书.在添加/删除程序"中修复了IIS Express.将本地主机证书从个人/证书"复制并粘贴到受信任的根证书",并且不再抱怨.

This is what worked for me. deleted all localhost certificates. ran repair IIS Express in Add/Remove Programs. Copy and pasted localhost certificate from Personal/Certificate to Trusted Root Certificates and it didn't complain anymore.

修复/重新安装IIS Express似乎并不能真正解决此问题(从IIS Express 10开始),真正的解决方案是将localhost证书添加到Trusted Rood证书中.

Repairing/reinstalling IIS Express does not appear to actually fix this issue (as of IIS Express 10), the real solution is to add the localhost certificate to Trusted Rood Certificates.

有关此操作的详细信息,请参见本博客文章: https://blogs.iis.net/robert_mcmurray/how-to-trust-the-iis-express-self-signed-certificate

Full details for how to do this is covered by this blog post: https://blogs.iis.net/robert_mcmurray/how-to-trust-the-iis-express-self-signed-certificate

总而言之,

  • 通过控制面板中的管理计算机证书"或在cmd提示符下运行certlm打开证书管理器
  • 个人下>证书将导出本地证书并将其保存到磁盘
    • 不要导出私钥!只需导出公共密钥即可.
    • Open the certificate manager via "manage computer certificates" in control panel or by running certlm in a cmd prompt
    • Under Personal>Certificates export the localhost cert and save it to disk
      • don't export the private key! Just export the public key.

      这篇关于Visual Studio 2017给出``将证书添加到受信任的根证书存储失败,并显示以下错误''的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆