@@ -1326,7 +1326,7 @@ describe('CSOT', function () {
13261326 } ) ;
13271327 } ) ;
13281328
1329- context ( 'when driver specific TLS options are provided' , function ( ) {
1329+ context ( 'when driver specific TLS options are provided with a secure context ' , function ( ) {
13301330 let client ;
13311331 let clientEncryption ;
13321332 // Note we set tlsCAFile and tlsCertificateKeyFile to 'nofilename' to also
@@ -1337,9 +1337,8 @@ describe('CSOT', function () {
13371337 tlsOptions : {
13381338 aws : {
13391339 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
13431342 }
13441343 } ,
13451344 extraOptions : getEncryptExtraOptions ( )
@@ -1356,28 +1355,24 @@ describe('CSOT', function () {
13561355 await client . close ( ) ;
13571356 } ) ;
13581357
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+ } ) ;
13811376 } ) ;
13821377 } ) ;
13831378 } ) ;
0 commit comments