我可以使用自签名证书在本地成功连接到我的mongodb。在mongo config下安全授权被设置为“disabled”,TLS被启用。在本地使用mongodump
命令
mongodump --ssl --authenticationDatabase admin --host=127.0.0.1 --port=27017 -u=admin -p=821ewuyuiuw3! --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
,但没有成功。有什么解决办法吗?
1条答案
按热度按时间ca1c2owp1#
我终于设法使它与以下两个命令一起工作了。
和