diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-10-24 17:19:30 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-10-29 12:35:30 -0300 |
commit | aa9b0460a9320a0ec12e45e75011fce6b102ac58 (patch) | |
tree | 717a581611477cb925199c388a8a019018d07038 /src/leap | |
parent | d3ca8c456c7220a65ef0f88042fe49fb438eddc9 (diff) |
Encode paths before use them.
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/bitmask/services/__init__.py | 7 | ||||
-rw-r--r-- | src/leap/bitmask/services/soledad/soledadbootstrapper.py | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/leap/bitmask/services/__init__.py b/src/leap/bitmask/services/__init__.py index f9456159..e62277b6 100644 --- a/src/leap/bitmask/services/__init__.py +++ b/src/leap/bitmask/services/__init__.py @@ -19,6 +19,7 @@ Services module. """ import logging import os +import sys from PySide import QtCore @@ -135,8 +136,12 @@ def download_service_config(provider_config, service_config, if token is not None: headers["Authorization"] = 'Token token="{0}"'.format(token) + verify = provider_config.get_ca_cert_path() + if verify: + verify = verify.encode(sys.getfilesystemencoding()) + res = session.get(config_uri, - verify=provider_config.get_ca_cert_path(), + verify=verify, headers=headers, timeout=REQUEST_TIMEOUT, cookies=cookies) diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py index 4619ba80..3bb5fd84 100644 --- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py +++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py @@ -20,6 +20,7 @@ Soledad bootstrapping import logging import os import socket +import sys from ssl import SSLError @@ -239,14 +240,15 @@ class SoledadBootstrapper(AbstractBootstrapper): """ # TODO: If selected server fails, retry with another host # (issue #3309) + encoding = sys.getfilesystemencoding() try: self._soledad = Soledad( uuid, - self._password.encode("utf-8"), - secrets_path=secrets_path, - local_db_path=local_db_path, + self._password.encode('utf-8'), + secrets_path=secrets_path.encode(encoding), + local_db_path=local_db_path.encode(encoding), server_url=server_url, - cert_file=cert_file, + cert_file=cert_file.encode(encoding), auth_token=auth_token) # XXX All these errors should be handled by soledad itself, |