带 Chrome 的 DotNet 开发证书

发布时间:2021-03-07 15:57

场景:

  1. Visual Studio 中的 DotNet Core 3.1 Web 应用程序模板

enter image description here

  1. 为在 Linux Docker 容器中运行的 HTTPS 进行配置

enter image description here

  1. 单击以在 Docker 上运行

enter image description here

  1. 点击“是”接受开发证书

enter image description here

  1. Chrome 中出现“不安全”错误

enter image description here

请有人解释如何解决这个问题。我跑 dotnet dev-certs https --clean 然后 dotnet dev-certs https --trust 的次数比我想数的多。我已经从 Personal -> Certificates 导出证书并导入到 Trusted Root Certification Authorities -> Certificates。即使在完全重启机器之后,Chrome 仍然只能在 Personal 中看到那个。如果我删除个人的,VS 只会让我再次接受,而 Chrome 仍然只能在个人中看到那个。

从模板创建项目并点击运行应该不难。

在某些 mod 将其标记为 DUPLICATE 之前,我已经花了 HOURS 在这里解决类似的问题以及验证证书是否将其添加到 Docker 映像的方法。没有任何效果。

这是怎么解决的?

回答1