summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/provider/providerbootstrapper.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-06-06 12:59:11 -0300
committerTomás Touceda <chiiph@leap.se>2014-06-11 12:16:42 -0300
commitcfc7122f07a3b16f2d9cb5421b739dae252604cb (patch)
treeb9db4cca4f1230f3dffa5acc001d2298a3fb6adc /src/leap/bitmask/provider/providerbootstrapper.py
parent6ca25420cce6264df850f580d7842910ab3d10d4 (diff)
Improve how pinned providers are handled
Diffstat (limited to 'src/leap/bitmask/provider/providerbootstrapper.py')
-rw-r--r--src/leap/bitmask/provider/providerbootstrapper.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/leap/bitmask/provider/providerbootstrapper.py b/src/leap/bitmask/provider/providerbootstrapper.py
index 6cdfe4f4..8c96a8b5 100644
--- a/src/leap/bitmask/provider/providerbootstrapper.py
+++ b/src/leap/bitmask/provider/providerbootstrapper.py
@@ -29,6 +29,7 @@ from leap.bitmask import util
from leap.bitmask.config import flags
from leap.bitmask.config.providerconfig import ProviderConfig, MissingCACert
from leap.bitmask.provider import get_provider_path
+from leap.bitmask.provider.pinned import PinnedProviders
from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper
from leap.bitmask.util.constants import REQUEST_TIMEOUT
from leap.bitmask.util.request_helpers import get_content
@@ -176,6 +177,14 @@ class ProviderBootstrapper(AbstractBootstrapper):
provider_json = os.path.join(util.get_path_prefix(),
get_provider_path(domain))
+ if domain in PinnedProviders.domains() and \
+ not os.path.exists(provider_json):
+ mkdir_p(os.path.join(os.path.dirname(provider_json),
+ "keys", "ca"))
+ cacert = os.path.join(os.path.dirname(provider_json),
+ "keys", "ca", "cacert.pem")
+ PinnedProviders.save_hardcoded(domain, provider_json, cacert)
+
mtime = get_mtime(provider_json)
if self._download_if_needed and mtime: