@@ -214,11 +214,15 @@ export class ClientEncryption {
214
214
keyMaterial
215
215
} ) ;
216
216
217
- const stateMachine = new StateMachine ( {
218
- proxyOptions : this . _proxyOptions ,
219
- tlsOptions : this . _tlsOptions ,
220
- socketOptions : autoSelectSocketOptions ( this . _client . s . options )
221
- } ) ;
217
+ const stateMachine = new StateMachine (
218
+ {
219
+ proxyOptions : this . _proxyOptions ,
220
+ tlsOptions : this . _tlsOptions ,
221
+ socketOptions : autoSelectSocketOptions ( this . _client . s . options )
222
+ } ,
223
+ undefined ,
224
+ this . _client . closeSignal
225
+ ) ;
222
226
223
227
const timeoutContext =
224
228
options ?. timeoutContext ??
@@ -283,11 +287,15 @@ export class ClientEncryption {
283
287
}
284
288
const filterBson = serialize ( filter ) ;
285
289
const context = this . _mongoCrypt . makeRewrapManyDataKeyContext ( filterBson , keyEncryptionKeyBson ) ;
286
- const stateMachine = new StateMachine ( {
287
- proxyOptions : this . _proxyOptions ,
288
- tlsOptions : this . _tlsOptions ,
289
- socketOptions : autoSelectSocketOptions ( this . _client . s . options )
290
- } ) ;
290
+ const stateMachine = new StateMachine (
291
+ {
292
+ proxyOptions : this . _proxyOptions ,
293
+ tlsOptions : this . _tlsOptions ,
294
+ socketOptions : autoSelectSocketOptions ( this . _client . s . options )
295
+ } ,
296
+ undefined ,
297
+ this . _client . closeSignal
298
+ ) ;
291
299
292
300
const timeoutContext = TimeoutContext . create (
293
301
resolveTimeoutOptions ( this . _client , { timeoutMS : this . _timeoutMS } )
@@ -687,11 +695,15 @@ export class ClientEncryption {
687
695
const valueBuffer = serialize ( { v : value } ) ;
688
696
const context = this . _mongoCrypt . makeExplicitDecryptionContext ( valueBuffer ) ;
689
697
690
- const stateMachine = new StateMachine ( {
691
- proxyOptions : this . _proxyOptions ,
692
- tlsOptions : this . _tlsOptions ,
693
- socketOptions : autoSelectSocketOptions ( this . _client . s . options )
694
- } ) ;
698
+ const stateMachine = new StateMachine (
699
+ {
700
+ proxyOptions : this . _proxyOptions ,
701
+ tlsOptions : this . _tlsOptions ,
702
+ socketOptions : autoSelectSocketOptions ( this . _client . s . options )
703
+ } ,
704
+ undefined ,
705
+ this . _client . closeSignal
706
+ ) ;
695
707
696
708
const timeoutContext =
697
709
this . _timeoutMS != null
@@ -712,7 +724,7 @@ export class ClientEncryption {
712
724
* the original ones.
713
725
*/
714
726
async askForKMSCredentials ( ) : Promise < KMSProviders > {
715
- return await refreshKMSCredentials ( this . _kmsProviders ) ;
727
+ return await refreshKMSCredentials ( this . _kmsProviders , this . _client . closeSignal ) ;
716
728
}
717
729
718
730
static get libmongocryptVersion ( ) {
@@ -771,11 +783,15 @@ export class ClientEncryption {
771
783
}
772
784
773
785
const valueBuffer = serialize ( { v : value } ) ;
774
- const stateMachine = new StateMachine ( {
775
- proxyOptions : this . _proxyOptions ,
776
- tlsOptions : this . _tlsOptions ,
777
- socketOptions : autoSelectSocketOptions ( this . _client . s . options )
778
- } ) ;
786
+ const stateMachine = new StateMachine (
787
+ {
788
+ proxyOptions : this . _proxyOptions ,
789
+ tlsOptions : this . _tlsOptions ,
790
+ socketOptions : autoSelectSocketOptions ( this . _client . s . options )
791
+ } ,
792
+ undefined ,
793
+ this . _client . closeSignal
794
+ ) ;
779
795
const context = this . _mongoCrypt . makeExplicitEncryptionContext ( valueBuffer , contextOptions ) ;
780
796
781
797
const timeoutContext =
0 commit comments