找不到合适的服务器(`serverSelectionTryOnce` set):[TLS握手失败:错误:14090086:SSL例程:ssl3_get_server_certificate configure-ssl

问题描述 投票:2回答:1

我试图将mongodb连接到php应用程序从compose到local,但是得到了这个错误。但我可以远程使用mongo厨师

找不到合适的服务器(serverSelectionTryOnce设置):[TLS握手失败:错误:14090086:SSL例程:ssl3_get_server_certificate:证书验证失败,调用ismaster

mongodb ssl-certificate
1个回答
0
投票

我认为你有3个选择来解决这个问题。

1. Disable SSL on your server

找到mongod.conf,如果你正在使用linux,那么通常它应该位于/etc/mongod.conf,使用#net下评论这些行。最后,您需要重新启动mongodb才能进行更改。

net: ssl: mode: requireSSL PEMKeyFile: ./mongodb.pem ...

2. Use the option called weak_cert_validation on your client

这不是安全解决方案,但这绝对是最简单的解决方案之一。

例如,如果mongoDB服务器启用了SSL但没有(或没有)提供CA证书(意味着自签名证书),那么在客户端将weak_cert_validation设置为true,这是C客户端的一个示例:

mongoc_ssl_opt_t ssl_opts = {0};
ssl_opts.weak_cert_validation = true;
mongoc_client_set_ssl_opts(client, &ssl_opts);

3. Follow configure-ssl to create a certificate and get it signed for your program.

这里有一些提供者:https://en.wikipedia.org/wiki/Certificate_authority#Providers

© www.soinside.com 2019 - 2024. All rights reserved.