gpt4 book ai didi

MongoDB 4.2.5 接收来自客户端的请求时出错 : SSLHandshakeFailed: The server is configured to only allow SSL connections

转载 作者:行者123 更新时间:2023-12-04 22:37:56 25 4
gpt4 key购买 nike

我正在尝试从客户端应用程序连接到 MongoDB 服务器。我启用了 TLS,并且我使用的是自签名证书。以下是详细信息:

OS: Windows Server 2016
MongoDB Version: 4.2.5

mongod.cfg (config file):
net:
tls:
mode: requireTLS
certificateSelector: subject=server1.com
allowInvalidCertificates: true
disabledProtocols: none
systemLog:
destination: file
path: F:\MongoDB\log\mongod.log
logAppend: true
storage:
dbPath: F:\MongoDB\data
net:
bindIp: localhost,server1.com
port: 27017

我创建了一个 RootCA,并创建了 server1.pfx (CN=server1.com)。然后导出 rootca.cer(无 key )和 server1.cer(无 key )并将它们安装在运行客户端应用程序的服务器上,并安装到受信任的根授权 (rootca.cer) 和个人 (server1.cer)。

我正在使用以下连接字符串:
mongodb://user:*******************@server1.com:27017/CustomerDB?authSource=CustomerDB&tls=true&tlsAllowInvalidCertificates=true

我得到的错误:
Error receiving request from client: SSLHandshakeFailed: The server is configured to only allow SSL connections

我添加了 tls=true,并在运行客户端应用程序的服务器上启用了 TLS 1.1 和 1.2。我能够从不同的应用程序连接到 MongoDB,该应用程序在具有相同连接字符串的不同服务器中运行。

最佳答案

您的客户端未使用 TLS。

请注意 tls=true是最近添加的选项。确保您使用的是当前版本的 MongoDB 驱动程序。

关于MongoDB 4.2.5 接收来自客户端的请求时出错 : SSLHandshakeFailed: The server is configured to only allow SSL connections,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61241048/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com