启动应用时报错

来源:3-7 【应用】添加初始化数据

慕粉3748812

2020-11-08

我在启动程序时 提示报错
System.InvalidOperationException: "Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.\nTo generate a developer certificate run ‘dotnet dev-certs https’. To trust the certificate (Windows and macOS only) run ‘dotnet dev-certs https --trust’.\nFor more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054."

使用了dotnet dev-certs https --trust 后报错
A valid HTTPS certificate with a key accessible across security partitions was not found. The following command will run to fix it:
‘sudo security set-key-partition-list -D localhost -S unsigned:,teamid:UBF8T346G9’

写回答

3回答

阿莱克斯刘

2020-11-11

你遇到的问题似乎是.net core 特定版本的bug,我在github上找到相似的问题:https://github.com/dotnet/aspnetcore/issues/19590

目前这个问题还是open的状态,还没有被解决,但是可以绕过:

//img.mukewang.com/szimg/5fab7d89099c607719960738.jpg

  1. 确保你打开你的Keychain Access,在login keychain中删除所有localhost的证书,在system keychain中删除ASP.NET Core的证书。

  2. 在terminal中打开bash

  3. 创建一个临时文件夹,cd进去

  4. 运行连接中的script:

https://gist.github.com/javiercn/d04855b7a3581bf97d1ab9597935413f#file-generate-sh


因为我没遇到这样的问题,所以无论你成功还是失败都请告诉我一下。谢谢



2
2
阿莱克斯刘
回复
慕粉3748812
good good thx
2020-11-15
共2条回复

阿莱克斯刘

2020-11-11

还找到一个:https://github.com/dotnet/runtime/issues/27132

//img.mukewang.com/szimg/5fab82c1093348c919140456.jpg


sudo dotnet dev-certs https --clean

然后再 dotnet dev-certs https

0
1
慕粉3748812
no useful
2020-11-14
共1条回复

阿莱克斯刘

2020-11-11

我在同一个github问题中找到另一个解决方案:https://github.com/dotnet/aspnetcore/issues/19590


//img.mukewang.com/szimg/5fab81a109e739ca19800830.jpg

0
0

.Net 开发电商后端API 从0到精通RESTful

. Net 实战+RESTful思想纵深课程,开发优雅RESTful风格API。

978 学习 · 547 问题

查看课程