1515"""Options to configure client side encryption."""
1616
1717import copy
18- import socket
1918
2019try :
2120 import pymongocrypt
@@ -32,7 +31,7 @@ class AutoEncryptionOpts(object):
3231 def __init__ (self , kms_providers , key_vault_namespace ,
3332 key_vault_client = None , schema_map = None ,
3433 bypass_auto_encryption = False ,
35- mongocryptd_uri = None ,
34+ mongocryptd_uri = 'mongodb://localhost:27020' ,
3635 mongocryptd_bypass_spawn = False ,
3736 mongocryptd_spawn_path = 'mongocryptd' ,
3837 mongocryptd_spawn_args = None ):
@@ -90,8 +89,7 @@ def __init__(self, kms_providers, key_vault_namespace,
9089 enabled. Defaults to ``False``.
9190 - `mongocryptd_uri` (optional): The MongoDB URI used to connect
9291 to the *local* mongocryptd process. Defaults to
93- ``"mongodb://%2Ftmp%2Fmongocryptd.sock"`` if domain sockets are
94- available or ``"mongodb://localhost:27020"`` otherwise.
92+ ``'mongodb://localhost:27020'``.
9593 - `mongocryptd_bypass_spawn` (optional): If ``True``, the encrypted
9694 MongoClient will not attempt to spawn the mongocryptd process.
9795 Defaults to ``False``.
@@ -117,11 +115,6 @@ def __init__(self, kms_providers, key_vault_namespace,
117115 self ._key_vault_client = key_vault_client
118116 self ._schema_map = schema_map
119117 self ._bypass_auto_encryption = bypass_auto_encryption
120- if mongocryptd_uri is None :
121- if hasattr (socket , 'AF_UNIX' ):
122- mongocryptd_uri = 'mongodb://%2Ftmp%2Fmongocryptd.sock'
123- else :
124- mongocryptd_uri = 'mongodb://localhost:27020'
125118 self ._mongocryptd_uri = mongocryptd_uri
126119 self ._mongocryptd_bypass_spawn = mongocryptd_bypass_spawn
127120 self ._mongocryptd_spawn_path = mongocryptd_spawn_path
0 commit comments