mongo 如果文件作为参数在 URL 中传递,客户端不会读取 CA 文件
mongo client doesnt read CA file if file is passed as parameter in URL
我正在尝试使用 AWS DocumentDB。
这个命令工作正常:
mongo --tls --host my.cluster-random.ap-south-1.docdb.amazonaws.com:27017 --tlsCAFile rds-combined-ca-bundle.pem --username mongo --password 'supersecure'
这个命令没有:
mongo 'mongodb://mongo@my.cluster-random.ap-south-1.docdb.amazonaws.com:27017/?tlsCAFile=rds-combined-ca-bundle.pem&tls=true'
我收到错误:
SSL peer certificate validation failed: unable to get local issuer certificate
我的印象是第二个案例文件没有被读取。如果我在第一个命令中输入错误的文件名 - 我会收到 OpenSSL 错误:
Failed global initialization: InvalidSSLConfiguration cannot read certificate authority file:
在第二种情况下,它似乎根本不重要。像“忽略”这样的 TLS 选项的任何组合也没有产生任何效果。
我有点迷茫。有什么建议吗?
好吧...无论出于何种原因,它在 mongo shell 中不受支持。来自文档:
https://docs.mongodb.com/manual/reference/connection-string/
tlsCAFile - 此连接字符串选项不适用于 mongo shell。请改用命令行选项。
我正在尝试使用 AWS DocumentDB。
这个命令工作正常:
mongo --tls --host my.cluster-random.ap-south-1.docdb.amazonaws.com:27017 --tlsCAFile rds-combined-ca-bundle.pem --username mongo --password 'supersecure'
这个命令没有:
mongo 'mongodb://mongo@my.cluster-random.ap-south-1.docdb.amazonaws.com:27017/?tlsCAFile=rds-combined-ca-bundle.pem&tls=true'
我收到错误:
SSL peer certificate validation failed: unable to get local issuer certificate
我的印象是第二个案例文件没有被读取。如果我在第一个命令中输入错误的文件名 - 我会收到 OpenSSL 错误:
Failed global initialization: InvalidSSLConfiguration cannot read certificate authority file:
在第二种情况下,它似乎根本不重要。像“忽略”这样的 TLS 选项的任何组合也没有产生任何效果。
我有点迷茫。有什么建议吗?
好吧...无论出于何种原因,它在 mongo shell 中不受支持。来自文档:
https://docs.mongodb.com/manual/reference/connection-string/
tlsCAFile - 此连接字符串选项不适用于 mongo shell。请改用命令行选项。