dev-certs生成无根证书

时间:2019-06-02 23:04:17

标签: .net https kestrel

我的操作系统是ubuntu 18.04

没有sudo不起作用

$ dotnet dev-certs https
There was an error saving the HTTPS developer certificate to the current user personal certificate store.

如果我使用

$ sudo dotnet dev-certs https

好的,但是只运行没有sudo的mvc程序

crit: Microsoft.AspNetCore.Server.Kestrel[0]
      Unable to start Kestrel.
System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found.
To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。 我删除.aspnet .dotnet和.nuget文件夹 重新运行dotnet dev-certs https