【问题标题】:.Net Nuget Package install rerturns ssl error.Net Nuget 包安装重新返回 ssl 错误
【发布时间】:2020-03-02 07:04:59
【问题描述】:

我正在尝试在我的 C# 项目中使用 Newtonsoft.Json.Serialization 命名空间。当我在谷歌上搜索时,我发现“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# 新手。谢谢。

【问题讨论】:

  • 可能有所不同,但在 3.1 中您应该安装 Microsoft.AspNetCore.Mvc.NewtonsoftJson。事实上,如果你是 C# 新手,那么使用 System.Text.Json 的内置功能可能就足够了,请参阅文档:docs.microsoft.com/en-us/dotnet/core/whats-new/…
  • 假设 ASP.NET Core。此问题仅使用 .NET Core 标记。
  • 谢谢。我尝试使用 Newtonsoft.Json 的一个原因是我需要将 Json 查询发送到 websocket 服务器。有没有办法在 System.Text.Json 命名空间中生成 Json 查询?

标签: c# .net .net-core nuget-package


【解决方案1】:

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

查看github issue here

在我的 /etc/ssl/certs 中,我注意到一些指向红色蛇油证书的链接。所以我的电脑中似乎缺少这些证书。

我重新创建它们,一切都恢复正常了。

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

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

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

【讨论】:

    猜你喜欢
    • 2017-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-03
    • 2011-09-28
    • 1970-01-01
    • 2013-09-08
    相关资源
    最近更新 更多