summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/bitmask_libraries/provider.py6
-rw-r--r--service/pixelated/config/leap.py1
2 files changed, 5 insertions, 2 deletions
diff --git a/service/pixelated/bitmask_libraries/provider.py b/service/pixelated/bitmask_libraries/provider.py
index cd4af7e2..02318ec2 100644
--- a/service/pixelated/bitmask_libraries/provider.py
+++ b/service/pixelated/bitmask_libraries/provider.py
@@ -68,6 +68,9 @@ class LeapProvider(object):
def download_soledad_json(self):
self.soledad_json = self.fetch_soledad_json()
+ def download_smtp_json(self):
+ self.smtp_json = self.fetch_smtp_json()
+
def download_certificate(self, filename=None):
"""
Downloads the server certificate, validates it against the provided fingerprint and stores it to file
@@ -113,8 +116,7 @@ class LeapProvider(object):
raise Exception('Certificate fingerprints don\'t match! Expected [%s] but got [%s]' % (fingerprint.strip(), digest))
def smtp_info(self):
- json_data = self.fetch_smtp_json()
- hosts = json_data['hosts']
+ hosts = self.smtp_json['hosts']
hostname = hosts.keys()[0]
host = hosts[hostname]
return host['hostname'], host['port']
diff --git a/service/pixelated/config/leap.py b/service/pixelated/config/leap.py
index 52e84386..91c8db1f 100644
--- a/service/pixelated/config/leap.py
+++ b/service/pixelated/config/leap.py
@@ -22,6 +22,7 @@ def initialize_leap_provider(provider_hostname, provider_cert, provider_fingerpr
provider.download_certificate()
LeapCertificate(provider).setup_ca_bundle()
provider.download_soledad_json()
+ provider.download_smtp_json()
return provider