.Net Nuget 包安装返回 ssl 错误

.Net Nuget Package install rerturns ssl error

我正在尝试在我的 C# 项目中使用 Newtonsoft.Json.Serialization 命名空间。当我在 Google 上搜索时,我发现 "dotnet package Newtonsoft.Json" 是一种在 ubuntu linux 上安装软件包的方法,但它返回以下错误:

writing /tmp/tmpC1RGW5.tmp
error:   The SSL connection could not be established, see inner exception.
error:   The remote certificate is invalid according to the validation procedure. 

.Net版本是3.1。 请帮助这个 C# 新手。谢谢

您的机器证书似乎有问题。

勾选github issue here

In my /etc/ssl/certs I notice some link to snakeoil certificate in red. so it seem these certificates are missing in my computer.

I recreate them and everything work again.

还有更多问题的链接,一些已修复,另一些与 ssl 的错误配置有关:

https://github.com/dotnet/corefx/issues/29942 https://github.com/dotnet/corefx/issues/30385 https://github.com/dotnet/corefx/issues/30388

这似乎不是网络核心问题,也不是 nuget 问题。它看起来更像是您工作站的连接问题,而不是其他任何问题。