asp.net-core - asp.net core web api本地https问题

标签 asp.net-core ssl https

我的 web api 不能使用 HTTPS,所以我尝试运行这个命令:

dotnet dev-certs https --trust
但我收到了这个错误:

Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate. There was an error trusting HTTPS developer certificate.


我也尝试清理并创建一个新的
dotnet dev-certs https -v
The HTTPS developer certificate was generated successfully.
但仍然面临同样的问题。
我在 CurrentUser\Personal\Certificates 中看不到 localhost 证书

最佳答案

如果您有多个证书,有时会发生这种情况。

  • 在 Run
  • 中执行 certmgr.msc
  • 清除所有 localhost 证书
  • 在命令行上执行 dotnet dev-certs https -t
  • 您可以使用 dotnet dev-certs https --check 检查证书。如果此命令没有返回任何内容,则一切正常。
  • 使用 dotnet run
  • 运行您的应用程序

    关于asp.net-core - asp.net core web api本地https问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60943525/

    相关文章:

    redirect - 循环重定向php

    amazon-web-services - 如何将 HTTPs 请求发送到 AWS 中的 ELB,以将其路由到附加到自动扩展组的其后面运行的 EC2 实例上的 HTTP 端口?

    c# - Asp.Net Core 5 使用应用程序部件注册 Controller

    asp.net - 路径长度太长时 TeamCity DNU 发布失败

    asp.net-core - _signInManager.GetExternalLoginInfoAsync() 总是返回 null 和打开 id 到 azure 广告

    c# - 依赖注入(inject)无法解析在 Azure 中运行的 .NET Core Function App 中的类型服务

    ssl - haproxy - 如何进行虚拟主机和 https 转发?

    java - 如何判断服务器或客户端身份验证是否以两种方式 SSL 握手失败

    redirect - Nginx 将 HTTP 重定向到 HTTPS 并将非 www 重定向到 ww

    asp.net-mvc - 当我使用 mvc 在 https 中发布表单时,密码可见