3 Answers
- Newest
- Most votes
- Most comments
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
answered 4 years ago
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
answered 4 years ago
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
})
answered 4 years ago
Relevant content
- asked 2 years ago
- Accepted Answerasked a month ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 9 months ago