summaryrefslogtreecommitdiff
path: root/src/leap/soledad/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/soledad/server.py')
-rw-r--r--src/leap/soledad/server.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/leap/soledad/server.py b/src/leap/soledad/server.py
index 331f64aa..e2944057 100644
--- a/src/leap/soledad/server.py
+++ b/src/leap/soledad/server.py
@@ -32,10 +32,22 @@ except ImportError:
from u1db.remote import http_app
+# Keep OpenSSL's tsafe before importing Twisted submodules so we can put
+# it back if Twisted==12.0.0 messes with it.
+from OpenSSL import tsafe
+old_tsafe = tsafe
+
from twisted.web.wsgi import WSGIResource
from twisted.internet import reactor
from twisted.python import log
+from twisted import version
+if version.base() == "12.0.0":
+ # Put OpenSSL's tsafe back into place. This can probably be removed if we
+ # come to use Twisted>=12.3.0.
+ import sys
+ sys.modules['OpenSSL.tsafe'] = old_tsafe
+
from couchdb.client import Server
from leap.soledad.backends.couch import CouchServerState