diff options
author | Kali Kaneko <kali@leap.se> | 2013-10-28 18:26:53 -0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-10-28 18:48:21 -0200 |
commit | 6c924e87562f5eb986f6e6bf592e2a9d41fa90f1 (patch) | |
tree | 9fba964baabe5a10751663b4e61f3c0d06e43ecb /src/leap/bitmask/crypto/srpauth.py | |
parent | 856a3301b025f3d14c36a0ec0c90563358780670 (diff) |
dependency pinning on requests
Diffstat (limited to 'src/leap/bitmask/crypto/srpauth.py')
-rw-r--r-- | src/leap/bitmask/crypto/srpauth.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index 47ed21b0..e7998e62 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -31,6 +31,7 @@ from PySide import QtCore from twisted.internet import threads from leap.bitmask.util import request_helpers as reqhelper +from leap.bitmask.util.compat import requests_has_max_retries from leap.bitmask.util.constants import REQUEST_TIMEOUT from leap.common.check import leap_assert from leap.common.events import signal as events_signal @@ -184,7 +185,11 @@ class SRPAuth(QtCore.QObject): # NOTE: This is a workaround for the moment, the server # side seems to return correctly every time, but it fails # on the client end. - self._session.mount('https://', HTTPAdapter(max_retries=30)) + if requests_has_max_retries: + adapter = HTTPAdapter(max_retries=30) + else: + adapter = HTTPAdapter() + self._session.mount('https://', adapter) def _safe_unhexlify(self, val): """ |