3 Respostas
- Mais recentes
- Mais votos
- Mais comentários
0
BTW I'm using mongoose 5.9.22 which is compatible with mongodb 3.6 and works against a local instance of mongodb installed. https://mongoosejs.com/docs/compatibility.html
respondido há 4 anos
0
I noticed the line below from https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-from-outside-a-vpc.html and updated my connection to not set the replicaSet and readPreference and I still have the same issue.
When using an SSH tunnel, we recommend that you connect to your cluster using the cluster endpoint and do not attempt to connect in replica set mode (i.e., specifying replicaSet=rs0 in your connection string) as it will result in an error.
I also updated my forwarding to connect to the instance instead of the endpoint without any luck.
Edited by: tnataws on Jul 20, 2020 7:33 PM
respondido há 4 anos
0
Finally figured it out -- thankfully user error and not an issue with any library. After switching to not set the replicaSet when connecting through tunnel, my TLS settings weren't getting set.
mongoose.createConnection('mongodb://localhost:27018', {
dbName: 'myDB',
retryWrites: false,
useFindAndModify: false,
useNewUrlParser: true,
useUnifiedTopology: true,
//replicaSet: 'rs0',
//readPreference: 'secondaryPreferred',
auth: {
user: '...',
password: '...'
},
tls: true
tlsCAFile: '/path/to/rds-combined-ca-bundle.pem',
tlsAllowInvalidHostNames: true
})
respondido há 4 anos
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 8 meses
- AWS OFICIALAtualizada há 2 anos