2 Unable to configure HTTPS endpoint.
吴长征 edited this page 2020-04-26 09:54:51 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

错误提示:

Microsoft.AspNetCore.Server.Kestrel|Unable to start Kestrel.
Unhandled exception. System.InvalidOperationException: Unable to configure HTTPS
 endpoint. No server certificate was specified, and the default developer certif
icate could not be found or is out of date.
To generate a developer certificate run 'dotnet dev-certs https'. To trust the c
ertificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?l
inkid=848054.

这个问题主要是core项目使用了HTTPS协议但是没有安装相关证书
仔细查看提示执行dotnet dev-certs https --trust即可。

执行完后提示:

欢迎使用 .NET Core 3.1!
---------------------
SDK 版本: 3.1.101

遥测
---------
.NET Core 工具收集使用数据,以帮助我们改善你的体验。数据是匿名的。它由 Microsoft
 收集并与社区共享。你可以通过使用喜欢的 shell 将 DOTNET_CLI_TELEMETRY_OPTOUT 环
境变量设置为 "1" 或 "true" 来选择退出遥测。

阅读有关 .NET Core CLI 工具遥测的更多信息: https://aka.ms/dotnet-cli-telemetry

----------------
查看文档: https://aka.ms/dotnet-docs
通过 GitHub 报告问题和查找源: https://github.com/dotnet/core
查找最新功能: https://aka.ms/dotnet-whats-new
了解已安装的 HTTPS 开发者证书: https://aka.ms/aspnet-core-https
使用 "dotnet --help" 查看可用命令或访问: https://aka.ms/dotnet-cli-docs
编写你的第一个应用: https://aka.ms/first-net-core-app
--------------------------------------------------------------------------------
------
Trusting the HTTPS development certificate was requested. A confirmation prompt
will be displayed if the certificate was not previously trusted. Click yes on th
e prompt to trust the certificate.
A valid HTTPS certificate is already present.