diff options
author | drebs <drebs@leap.se> | 2013-05-23 15:56:16 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-05-23 16:03:11 -0300 |
commit | 0cab642cb1b93185c85bacf10b7ca93a313b7f66 (patch) | |
tree | 69f252974fe9300a09a9d594f79aca3334fe0b93 /src/leap | |
parent | 5da6cb3a430ee3f510552051bf79e4aa36fd6ad1 (diff) |
Prevent Twisted==12.0.0 from messing with OpenSSL.
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/soledad/server.py | 12 |
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 |