summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/provider
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/provider')
-rw-r--r--src/leap/bitmask/provider/__init__.py13
-rw-r--r--src/leap/bitmask/provider/pinned.py5
-rw-r--r--src/leap/bitmask/provider/pinned_riseup.py2
-rw-r--r--src/leap/bitmask/provider/providerbootstrapper.py4
4 files changed, 17 insertions, 7 deletions
diff --git a/src/leap/bitmask/provider/__init__.py b/src/leap/bitmask/provider/__init__.py
index 89ff5d95..4385a92f 100644
--- a/src/leap/bitmask/provider/__init__.py
+++ b/src/leap/bitmask/provider/__init__.py
@@ -17,6 +17,7 @@
"""
Provider utilities.
"""
+import logging
import os
from pkg_resources import parse_version
@@ -24,6 +25,8 @@ from pkg_resources import parse_version
from leap.bitmask import __short_version__ as BITMASK_VERSION
from leap.common.check import leap_assert
+logger = logging.getLogger(__name__)
+
# The currently supported API versions by the client.
SUPPORTED_APIS = ["1"]
@@ -62,4 +65,12 @@ def supports_client(minimum_version):
:returns: True if that version is supported or False otherwise.
:return type: bool
"""
- return parse_version(minimum_version) <= parse_version(BITMASK_VERSION)
+ try:
+ min_ver = parse_version(minimum_version)
+ cur_ver = parse_version(BITMASK_VERSION)
+ supported = min_ver <= cur_ver
+ except TypeError as exc:
+ logger.error("Error while parsing versions")
+ logger.exception(exc)
+ supported = False
+ return supported
diff --git a/src/leap/bitmask/provider/pinned.py b/src/leap/bitmask/provider/pinned.py
index 09fcc52c..ea1788eb 100644
--- a/src/leap/bitmask/provider/pinned.py
+++ b/src/leap/bitmask/provider/pinned.py
@@ -17,13 +17,12 @@
"""
Pinned Providers
"""
-import logging
-
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.provider import pinned_calyx
from leap.bitmask.provider import pinned_demobitmask
from leap.bitmask.provider import pinned_riseup
-logger = logging.getLogger(__name__)
+logger = get_logger()
class PinnedProviders(object):
diff --git a/src/leap/bitmask/provider/pinned_riseup.py b/src/leap/bitmask/provider/pinned_riseup.py
index 8cc51506..8cfca6ce 100644
--- a/src/leap/bitmask/provider/pinned_riseup.py
+++ b/src/leap/bitmask/provider/pinned_riseup.py
@@ -22,7 +22,7 @@ DOMAIN = "riseup.net"
PROVIDER_JSON = """
{
- "api_uri": "https://api.black.riseup.net:4430",
+ "api_uri": "https://api.black.riseup.net:443",
"api_version": "1",
"ca_cert_fingerprint": "SHA256: a5244308a1374709a9afce95e3ae47c1b44bc2398c0a70ccbf8b3a8a97f29494",
"ca_cert_uri": "https://black.riseup.net/ca.crt",
diff --git a/src/leap/bitmask/provider/providerbootstrapper.py b/src/leap/bitmask/provider/providerbootstrapper.py
index efba29f9..28944d89 100644
--- a/src/leap/bitmask/provider/providerbootstrapper.py
+++ b/src/leap/bitmask/provider/providerbootstrapper.py
@@ -17,7 +17,6 @@
"""
Provider bootstrapping
"""
-import logging
import socket
import os
import sys
@@ -28,6 +27,7 @@ from leap.bitmask import provider
from leap.bitmask import util
from leap.bitmask.config import flags
from leap.bitmask.config.providerconfig import ProviderConfig, MissingCACert
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.provider import get_provider_path
from leap.bitmask.provider.pinned import PinnedProviders
from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper
@@ -38,7 +38,7 @@ from leap.common.certs import get_digest
from leap.common.check import leap_assert, leap_assert_type, leap_check
from leap.common.files import check_and_fix_urw_only, get_mtime, mkdir_p
-logger = logging.getLogger(__name__)
+logger = get_logger()
class UnsupportedProviderAPI(Exception):