【发布时间】:2022-07-20 14:32:40
【问题描述】:
我可以使用自签名证书在本地成功连接我的 mongodb。 mongo 配置下的安全授权设置为“禁用”,并启用了 TLS。在本地使用mongodump 命令
mongodump --ssl --authenticationDatabase admin --host=127.0.0.1 --port=27017 -u=admin -p=8ewuyuiuw3! --sslPEMKeyFile=/etc/ssl/mongodb.pem --sslCAFile=/etc/ssl/rootCA.pem --archive=/home/backups/mongodump.gz --gzip
尽管我禁用了授权,但管理员用户仍然存在。如果没有凭据,我也会遇到同样的错误。
我总是得到错误:
2021-12-03T14:58:29.420+0200 Failed: can't create session: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: 127.0.0.1:27017, Type: Unknown, Last error: connection() error occured during connection handshake: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs }, ] }
我也尝试使用export GODEBUG=x509ignoreCN=0,但没有成功。有什么解决办法吗?
【问题讨论】:
-
你解决了吗?
-
@Ermal 是的,你有同样的问题吗?
-
是的。我不知道是否需要配置 --ssl 或其他任何东西。但我也无法通过命令行连接。 (
mongodb://localhost:27017/novi_dedicated --ssl --authenticationDatabase admin)。你能回答你自己的问题吗?如果它可以解决我的问题,我将设置为已回答。 -
@Ermal 是的,我明天会做,目前我不在办公室
标签: mongodb mongodb-query mongodump