我在Apache配置文件中有我的mongo详细信息。并得到此错误。
SetEnv MONGO_URL mongodb://:@ XXXXXXXXX.docdb.amazonaws.com:27017 /?ssl = true&ssl_ca_certs = / home / ec2-user / rds-combined-ca-bundle.pem&replicaSet = rs0&readPreference = secondaryPreferred&retryWrites = false
App 2291 output: MongoNetworkError: failed to connect to server [XXXXXX.docdb.amazonaws.com:27017] on first connect [Error: unable to get local issuer certificate
App 2291 output: at TLSSocket.onConnectSecure (_tls_wrap.js:1474:34)
App 2291 output: at TLSSocket.emit (events.js:310:20)
App 2291 output: at TLSSocket.EventEmitter.emit (domain.js:482:12)
App 2291 output: at TLSSocket._finishInit (_tls_wrap.js:917:8)
App 2291 output: at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:687:12) {
App 2291 output: name: 'MongoNetworkError',
App 2291 output: [Symbol(mongoErrorContextSymbol)]: {}
App 2291 output: }]
MongoNetworkError:[错误:无法获取本地发行者证书
启用TLS后,默认情况下,客户端和服务器都会验证彼此的证书。这意味着它们两个都需要指定一个CA证书,该证书对握手期间另一方出示的证书有效,同时还要包含任何中间证书。
关于节点驱动程序,请参阅here了解TLS选项的名称。 ssl_ca_certs
不是其中之一。