summaryrefslogtreecommitdiff
path: root/src/leap/soledad/__init__.py
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-05-01 10:16:16 -0300
committerdrebs <drebs@leap.se>2013-05-01 12:14:13 -0300
commit8de4777d42f474909390e0db7bb61e912bf7141f (patch)
treed8af2a473fa22da2969c7875bd2733e6a6e3a0ea /src/leap/soledad/__init__.py
parent718a10190b5da5eb9e63157658b4035822fb866e (diff)
Monkey patch u1db to allow self-signed SSL cert
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r--src/leap/soledad/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 791f8331..fb4c5520 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -48,6 +48,8 @@ from leap.soledad.backends.leap_backend import (
DocumentNotEncrypted,
LeapSyncTarget,
)
+
+from leap.soledad import shared_db
from leap.soledad.shared_db import SoledadSharedDatabase
from leap.soledad.crypto import SoledadCrypto
@@ -133,7 +135,7 @@ class Soledad(object):
"""
def __init__(self, uuid, passphrase, secret_path, local_db_path,
- server_url, auth_token=None, bootstrap=True):
+ server_url, cert_file, auth_token=None, bootstrap=True):
"""
Initialize configuration, cryptographic keys and dbs.
@@ -151,6 +153,9 @@ class Soledad(object):
with the user's remote db and to interact with the shared recovery
database.
@type server_url: str
+ @param cert_file: Path to the SSL certificate to use in the
+ connection to the server_url.
+ @type cert_file: str
@param auth_token: Authorization token for accessing remote databases.
@type auth_token: str
@param bootstrap: True/False, should bootstrap this instance? Mostly
@@ -162,6 +167,9 @@ class Soledad(object):
self._passphrase = passphrase
self._init_config(secret_path, local_db_path, server_url)
self._set_token(auth_token)
+
+ shared_db.SOLEDAD_CERT = cert_file
+
if bootstrap:
self._bootstrap()