summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/_checks.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-01-10 12:31:17 +0100
committerKali Kaneko <kali@leap.se>2018-01-25 01:19:10 +0100
commit5ffa0c1710ce4038b94a026a58daf8f12aef2ec4 (patch)
tree61723ea8c2385b2930ed82f401f52d6239ecc221 /src/leap/bitmask/vpn/_checks.py
parent5510c24e61046269e5b29df7d7ffb67a42bdc763 (diff)
[feat] support anonymous vpn
honor the anonymous certificate for the providers that offer it. this still needs a change in bonafide, in which if provider supports anonymous access we still have to download eip-service.json for testing, I assume this has been already manually downloaded.
Diffstat (limited to 'src/leap/bitmask/vpn/_checks.py')
-rw-r--r--src/leap/bitmask/vpn/_checks.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/leap/bitmask/vpn/_checks.py b/src/leap/bitmask/vpn/_checks.py
index c8f7dd36..9586d096 100644
--- a/src/leap/bitmask/vpn/_checks.py
+++ b/src/leap/bitmask/vpn/_checks.py
@@ -17,14 +17,19 @@ class ImproperlyConfigured(Exception):
pass
-def is_service_ready(provider):
+def get_failure_for(provider):
if not _has_valid_cert(provider):
raise ImproperlyConfigured('Missing VPN certificate')
-
if IS_LINUX and not is_pkexec_in_system():
- log.warn('System has no pkexec')
raise NoPkexecAvailable()
+
+def is_service_ready(provider):
+ if not _has_valid_cert(provider):
+ return False
+ if IS_LINUX and not is_pkexec_in_system():
+ log.warn('System has no pkexec')
+ return False
return True