summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-08-25 12:01:19 +0200
committerNavaL <ayoyo@thoughtworks.com>2016-08-25 12:01:19 +0200
commit730c53fe5b9fac660729b99afba2db20ca51313e (patch)
tree44cbf401432d52a0012a0cab023f0e5ed39ee750
parent54d488f148210d35b0d320860785b02185ad4e8d (diff)
[feat] allowing for optional injection of the combined_ca_bundle filename
For the multi-tenancy case, the combined_ca_bundle could be done once to avoid unnecessary disk IO for each user. The default case is still valid, and will not cause issues anywhere.
-rw-r--r--src/leap/keymanager/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py
index 24f37a9..ac9f8eb 100644
--- a/src/leap/keymanager/__init__.py
+++ b/src/leap/keymanager/__init__.py
@@ -92,7 +92,7 @@ class KeyManager(object):
def __init__(self, address, nickserver_uri, soledad, token=None,
ca_cert_path=None, api_uri=None, api_version=None, uid=None,
- gpgbinary=None):
+ gpgbinary=None, combined_ca_bundle=None):
"""
Initialize a Key Manager for user's C{address} with provider's
nickserver reachable in C{nickserver_uri}.
@@ -125,7 +125,7 @@ class KeyManager(object):
self.api_version = api_version
self.uid = uid
self._openpgp = OpenPGPScheme(soledad, gpgbinary=gpgbinary)
- self._combined_ca_bundle = self._create_combined_bundle_file()
+ self._combined_ca_bundle = combined_ca_bundle or self._create_combined_bundle_file()
self._async_client = HTTPClient(self._combined_ca_bundle)
self._nicknym = Nicknym(self._nickserver_uri, self._ca_cert_path, self._token)
self.refresher = None