Manjaro / Arch Linux - 我如何信任我的 AspNet Dev 证书?

Kei*_*son 2 linux ssl-certificate manjaro asp.net-core

我使用 Manjaro 进行 dotnet 开发,最近在 SSL 方面遇到了严重问题。

当我运行网络应用程序时,我收到一条警告:The ASP.NET Core developer certificate is not trusted. For information about trusting the ASP.NET Core developer certificate, see https://aka.ms/aspnet/https-trust-dev-cert.

我已经仔细浏览了该链接 - 它对我们 Linux 用户没有多大帮助,对 Manjaro / Arch 则没有多大帮助。

这让我在房子里转了一圈,试图弄清楚我需要做什么才能真正信任这个证书——我该运行什么?它实际存储在哪里?

我找到了很多信息,其中大部分似乎都已经过时了。我现在让自己陷入了一些混乱——它仍然不起作用,我已经尝试了很多东西。

我从 Github 上的一篇文章推断出以下命令,但我不确定存储位置是否正确。

# Start at home
cd ~

# Create cert
dotnet dev-certs https

# Export cert to current directory
dotnet dev-certs https -ep localhost.crt --format PEM

# Create the paths if necessary
cd /usr/share/ca-certificates
sudo mkdir trust-source
sudo chmod 755 trust-source
cd trust-source
sudo mkdir anchors
sudo chmod 755 anchors
cd ~

# Trust Chromium based browsers
sudo -E dotnet dev-certs https -ep /usr/share/ca-certificates/aspnet/https.crt --format PEM
sudo certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n localhost -i ./localhost.crt
sudo certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n localhost -i ./localhost.crt

# Trust wget
sudo cp localhost.crt /usr/share/ca-certificates/trust-source/anchors/aspnetcore-https-localhost.pem
sudo update-ca-trust extract

# Trust dotnet-to-dotnet
sudo cp localhost.crt /etc/ssl/certs/aspnetcore-https-localhost.pem

# Remove cert from current directory
rm localhost.crt
Run Code Online (Sandbox Code Playgroud)

我几乎要放弃并回到 WIndows 工作,我真的不想这样做,因为我发现 Linux 更适合前端开发,而且我发现 Manjaro 总体上比 Ubuntu 好得多,随着时间的推移,这将是我的替代选择。

Kri*_*ris 5

希望你还没有放弃。

转到这里: https: //github.com/BorisWilhelms/create-dotnet-devcert

脚步:

  • git clone git@github.com:BorisWilhelms/create-dotnet-devcert.git
  • cd create-dotnet-devcert
  • . ./scripts/arch-create-dotnet-devcert

你就完成了!