summaryrefslogtreecommitdiff
path: root/src/leap/services
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 /src/leap/services
parent66464e6a2ea48d3dbafaa7c11b14478e7d34ab4d (diff)
Get eip cert with session_id when possible
Diffstat (limited to 'src/leap/services')
-rw-r--r--src/leap/services/eip/eipbootstrapper.py9
1 files changed, 8 insertions, 1 deletions
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