-
Type:
Bug
-
Resolution: Done
-
Priority:
Unknown
-
None
-
Affects Version/s: 4.11.0
-
Component/s: Client Side Encryption
What problem are you facing?
I am following the official document at https://www.mongodb.com/docs/manual/core/csfle/tutorials/aws/aws-automatic/ (which is not compatible with the latest client version...).
I was able to create the data key, but when trying to connect to mongo I am getting cryptic error:
```
const timeoutError = new MongoServerSelectionError(
^
MongoServerSelectionError: connect ECONNREFUSED ::1:27020
at Timeout._onTimeout (/Users/omerlh/dev/stripe-event-handler/node_modules/mongodb/src/sdam/topology.ts:591:30)
at listOnTimeout (node:internal/timers:564:17)
at processTimers (node:internal/timers:507:7) {
reason: TopologyDescription
,
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {}
}
```
The client works and connects with no issues when `autoEncryption` is not specified.
This is my code:
```
const credentialsProvider = fromNodeProviderChain();
constcredentials = awaitcredentialsProvider();
returnMongoClient.connect(`${uri}/${dbName}`, {
autoEncryption: {
keyVaultNamespace,
kmsProviders: {
aws:
,
},
schemaMap: {
// eslint-disable-next-line @typescript-eslint/naming-convention
'db.data': {
bsonType:'object',
encryptMetadata:
,
properties: {
someKey: {
bsonType:'string',
properties: {
policyNumber: {
encrypt:
,
},
},
},
},
},
},
},
});
```
What driver and relevant dependency versions are you using?
Driver - 4.11.0
mongodb-client-encryption - 2.3.0
server - latest one installed by brew
Steps to reproduce?
See above