@@ -1326,7 +1326,7 @@ describe('CSOT', function () {
1326
1326
} ) ;
1327
1327
} ) ;
1328
1328
1329
- context ( 'when driver specific TLS options are provided' , function ( ) {
1329
+ context ( 'when driver specific TLS options are provided with a secure context ' , function ( ) {
1330
1330
let client ;
1331
1331
let clientEncryption ;
1332
1332
// Note we set tlsCAFile and tlsCertificateKeyFile to 'nofilename' to also
@@ -1337,9 +1337,8 @@ describe('CSOT', function () {
1337
1337
tlsOptions : {
1338
1338
aws : {
1339
1339
secureContext : tls . createSecureContext ( secureContextOptions ) ,
1340
- tlsCAFile : 'nofilename' ,
1341
- tlsCertificateKeyFile : 'nofilename' ,
1342
- tlsCertificateKeyFilePassword : 'invalid'
1340
+ tlsCAFile : process . env . CSFLE_TLS_CA_FILE ,
1341
+ tlsCertificateKeyFile : process . env . CSFLE_TLS_CLIENT_CERT_FILE
1343
1342
}
1344
1343
} ,
1345
1344
extraOptions : getEncryptExtraOptions ( )
@@ -1356,28 +1355,24 @@ describe('CSOT', function () {
1356
1355
await client . close ( ) ;
1357
1356
} ) ;
1358
1357
1359
- it (
1360
- 'successfully connects with TLS without attempting to parse the driver specific options' ,
1361
- metadata ,
1362
- async function ( ) {
1363
- // Use client encryption to create a data key. If this succeeds, then TLS worked.
1364
- const awsDatakeyId = await clientEncryption . createDataKey ( 'aws' , {
1365
- masterKey,
1366
- keyAltNames : [ 'aws_altname' ]
1367
- } ) ;
1368
- expect ( awsDatakeyId ) . to . have . property ( 'sub_type' , 4 ) ;
1369
- // Use the client to get the data key. If this succeeds, then the TLS connection
1370
- // for auto encryption worked.
1371
- const results = await client
1372
- . db ( keyVaultDbName )
1373
- . collection ( keyVaultCollName )
1374
- . find ( { _id : awsDatakeyId } )
1375
- . toArray ( ) ;
1376
- expect ( results )
1377
- . to . have . a . lengthOf ( 1 )
1378
- . and . to . have . nested . property ( '0.masterKey.provider' , 'aws' ) ;
1379
- }
1380
- ) ;
1358
+ it ( 'successfully connects with TLS' , metadata , async function ( ) {
1359
+ // Use client encryption to create a data key. If this succeeds, then TLS worked.
1360
+ const awsDatakeyId = await clientEncryption . createDataKey ( 'aws' , {
1361
+ masterKey,
1362
+ keyAltNames : [ 'aws_altname' ]
1363
+ } ) ;
1364
+ expect ( awsDatakeyId ) . to . have . property ( 'sub_type' , 4 ) ;
1365
+ // Use the client to get the data key. If this succeeds, then the TLS connection
1366
+ // for auto encryption worked.
1367
+ const results = await client
1368
+ . db ( keyVaultDbName )
1369
+ . collection ( keyVaultCollName )
1370
+ . find ( { _id : awsDatakeyId } )
1371
+ . toArray ( ) ;
1372
+ expect ( results )
1373
+ . to . have . a . lengthOf ( 1 )
1374
+ . and . to . have . nested . property ( '0.masterKey.provider' , 'aws' ) ;
1375
+ } ) ;
1381
1376
} ) ;
1382
1377
} ) ;
1383
1378
} ) ;
0 commit comments