1

尝试使用 mongocxx C++ 驱动程序连接到 AWS DocumentDB 时,即使在使用 AWS 组合 pem 文件作为 URI 参数(CA 文件)之后,我也会收到以下 TLS 握手失败的错误。

No suitable servers found (`serverSelectionTryOnce` set): [TLS handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed calling ismaster on 'docdb-xxxxxxxx.ap-southeast-1.docdb.amazonaws.com:27017']: generic server error 

我已经屏蔽了 documentdb 实例的完整主机名。我正在使用http://mongocxx.org/mongocxx-v3/configuration/中提到的连接 URI 方法

// 2) Using the URI
auto client2 = mongocxx::client{uri{"mongodb://host1/?tls=true&tlsAllowInvalidCertificates=true&tlsCAFile=/path/to/custom/cert.pem"}};

我正在使用 mongocxx 3.4.2 和 libmongoc 1.16.2

我已经尝试过与 Node.js 驱动程序的这种连接,并且它能够连接。有什么想法可能是错的吗?

4

0 回答 0