无法信任ASP.NET Core中的本地HTTPs证书 [英] Trouble trusting local HTTPs certificate in ASP.NET Core

查看:1114
本文介绍了无法信任ASP.NET Core中的本地HTTPs证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注创建ASP.Net Core Web应用程序的在线教程.我遵循了所有内容,但是在信任本地Https证书时遇到了麻烦.

I am following an online tutorial to create an ASP.Net Core Web application. I followed everything but had trouble with trusting the local Https certificate.

当我第一次运行该应用程序时,出现错误消息: 访问控制列表(acl)结构无效"

when I first run the application, I got an error saying: "the access control list (acl) structure is invalid"

我尝试使用谷歌搜索此错误,但找不到与我的ASP.NET应用程序相关的任何内容,在清理解决方案后,我再也没有收到此错误.

I tried googling this error but couldn't find anything related to my ASP.NET application, after cleaning the solution I didn't get this error any longer.

但是我无法使用Https在浏览器中运行我的应用程序,因为它总是说: 此网站不安全"

But I was unable to run my application in browser using Https as it always says: "This site is not secure"

我尝试使用以下命令使用CMD信任证书:

I tried to trust certificate using CMD using this command:

dotnet dev-certs https --trust

它应该显示提示我信任证书,但提示"信任HTTPs开发人员证书时出错",并且应用程序在浏览器上以不安全的模式运行.

It should show me a prompt to trust the certificate but it says "there was an error trusting the HTTPs developer certificate" and the application runs in an unsafe mode on the browser.

有人可以帮助我在本地环境中使用Https运行我的应用程序吗?任何帮助将不胜感激.谢谢

can someone please help me run my application with Https on my local environment? Any help will be greatly appreciated. Thanks

推荐答案

这似乎是ASP.NET Core 2.1中的错误:

This seems to be a bug in ASP.NET Core 2.1:

您需要做的是从证书管理器中移出添加的证书.

what you need to do is go move your added certificates from your certificate manager.

转到开始菜单>键入"Ctrl + R",键入"certlm.msc",这将打开您的证书管理器.

go to start menu > Type "Ctrl + R" type "certlm.msc", this will open your certificate manager.

转到个人/证书

您将在此处找到名为" localhost "的证书.

you will find a certificate named "localhost there.

将其移至受信任的根证书颁发机构/证书"

Move that to "Trusted Root Certification Authorities/Certificates"

再次运行该项目,它应该可以工作.

run the project again, and it should work.

希望这会有所帮助.

这篇关于无法信任ASP.NET Core中的本地HTTPs证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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