diff --git a/pymongo/asynchronous/encryption.py b/pymongo/asynchronous/encryption.py index 4dfd36aa49..7f4f2f2a2f 100644 --- a/pymongo/asynchronous/encryption.py +++ b/pymongo/asynchronous/encryption.py @@ -714,10 +714,12 @@ def __init__( self._io_callbacks: Optional[_EncryptionIO] = _EncryptionIO( None, key_vault_coll, None, opts ) + + # Pass bypass_encryption=True to skip loading crypt_shared. self._encryption = AsyncExplicitEncrypter( self._io_callbacks, _create_mongocrypt_options( - kms_providers=kms_providers, schema_map=None, key_expiration_ms=key_expiration_ms + kms_providers=kms_providers, schema_map=None, key_expiration_ms=key_expiration_ms, bypass_encryption=True ), ) # Use the same key vault collection as the callback. diff --git a/pymongo/synchronous/encryption.py b/pymongo/synchronous/encryption.py index 2d666b9763..9ffa00cad6 100644 --- a/pymongo/synchronous/encryption.py +++ b/pymongo/synchronous/encryption.py @@ -707,10 +707,15 @@ def __init__( self._io_callbacks: Optional[_EncryptionIO] = _EncryptionIO( None, key_vault_coll, None, opts ) + + # Pass bypass_encryption=True to skip loading crypt_shared. self._encryption = ExplicitEncrypter( self._io_callbacks, _create_mongocrypt_options( - kms_providers=kms_providers, schema_map=None, key_expiration_ms=key_expiration_ms + kms_providers=kms_providers, + schema_map=None, + key_expiration_ms=key_expiration_ms, + bypass_encryption=True, ), ) # Use the same key vault collection as the callback.