【问题标题】:C# says invalid certificate error on Linux CentosC# 在 Linux Centos 上说无效证书错误
【发布时间】:2019-10-31 10:08:21
【问题描述】:

我们正在使用部署在 Linux CentOS 中的 C# API(.NET 核心版本 2.2)中的 C# 驱动程序“Mongo Db 驱动程序 2.9.2”连接到部署在 Linux CentOS 上的 Mongo 服务器 4.2。 Mongo 上启用了 TLS,并使用了自签名证书。相同的代码和证书在 Windows 机器上工作,但在 Linux 上我们收到以下错误。请建议:

使用 CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } } 选择服务器 30000 毫秒后发生超时。集群状态的客户端视图是 { ClusterId : \"1\", ConnectionMode : \"Automatic\", Type : \"Unknown\", State : \"Disconnected\", Servers : [{ ServerId: \"{ ClusterId : 1、EndPoint:\"Unspecified/ServerName\" }\", EndPoint:\"Unspecified/ip-ServerName\", State:\"Disconnected\", Type:\"Unknown\", HeartbeatException:\"MongoDB.Driver .MongoConnectionException: 打开与服务器的连接时发生异常。---> System.Security.Authentication.AuthenticationException: 根据验证过程,远程证书无效。\n 在 System.Net.Security.SslState.StartSendAuthResetSignal

【问题讨论】:

    标签: mongodb


    【解决方案1】:

    我们可以通过使用服务器证书而不是通配符证书来解决这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-17
      • 1970-01-01
      • 2020-10-23
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 2016-03-14
      • 1970-01-01
      相关资源
      最近更新 更多