summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-12 14:26:38 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-12 14:26:38 -0300
commita120904b512394346b286bb417adf34fc622e739 (patch)
tree49725d30297c8036a4c48308dde12f6bc2f0e05c
parent66464e6a2ea48d3dbafaa7c11b14478e7d34ab4d (diff)
Get eip cert with session_id when possible
-rw-r--r--src/leap/crypto/srpauth.py3
-rw-r--r--src/leap/services/eip/eipbootstrapper.py9
2 files changed, 11 insertions, 1 deletions
diff --git a/src/leap/crypto/srpauth.py b/src/leap/crypto/srpauth.py
index 2877efab..c1964514 100644
--- a/src/leap/crypto/srpauth.py
+++ b/src/leap/crypto/srpauth.py
@@ -390,6 +390,9 @@ class SRPAuth(QtCore.QObject):
self.authentication_finished.emit(False, "%s" % (e,))
return False
+ def get_session_id(self):
+ return self.__instance.get_session_id()
+
def logout(self):
"""
Logs out the current session.
diff --git a/src/leap/services/eip/eipbootstrapper.py b/src/leap/services/eip/eipbootstrapper.py
index 79ff28d6..6fbb98b9 100644
--- a/src/leap/services/eip/eipbootstrapper.py
+++ b/src/leap/services/eip/eipbootstrapper.py
@@ -26,6 +26,7 @@ import errno
from PySide import QtGui, QtCore
+from leap.crypto.srpauth import SRPAuth
from leap.config.providerconfig import ProviderConfig
from leap.services.eip.eipconfig import EIPConfig
from leap.util.check import leap_assert, leap_assert_type
@@ -158,12 +159,18 @@ class EIPBootstrapper(QtCore.QObject):
return download_cert[self.PASSED_KEY]
try:
+ srp_auth = SRPAuth(self._provider_config)
+ session_id = srp_auth.get_session_id()
+ cookies = None
+ if session_id:
+ cookies = {"_session_id": session_id}
res = self._session.get("%s/%s/%s/" %
(self._provider_config.get_api_uri(),
self._provider_config.get_api_version(),
"cert"),
verify=self._provider_config
- .get_ca_cert_path())
+ .get_ca_cert_path(),
+ cookies=cookies)
res.raise_for_status()
client_cert = res.content