File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -435,11 +435,11 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
435
435
436
436
if ( options . tls ) {
437
437
if ( typeof options . tlsCAFile === 'string' ) {
438
- options . ca ??= await fs . readFile ( options . tlsCAFile , { encoding : 'utf8' } ) ;
438
+ options . ca ??= await fs . readFile ( options . tlsCAFile ) ;
439
439
}
440
440
if ( typeof options . tlsCertificateKeyFile === 'string' ) {
441
- if ( typeof options . key !== 'string' || typeof options . cert !== 'string' ) {
442
- const contents = await fs . readFile ( options . tlsCertificateKeyFile , { encoding : 'utf8' } ) ;
441
+ if ( ! options . key || ! options . cert ) {
442
+ const contents = await fs . readFile ( options . tlsCertificateKeyFile ) ;
443
443
options . key ??= contents ;
444
444
options . cert ??= contents ;
445
445
}
You can’t perform that action at this time.
0 commit comments