summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-05-15 17:37:44 -0300
committerTomás Touceda <chiiph@leap.se>2013-05-15 17:37:44 -0300
commite5098575632e9c5eaf4aba4a17cc4506196662df (patch)
tree6bbea4657a06e4bad23fb3ccd6f4330a77b26ba0
parent021078750d24162d24d7474f8b1fe97ef9467784 (diff)
Add hostname checking
Also remove some trailing whitespace
-rw-r--r--src/leap/soledad/__init__.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 84935191..b511f13d 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -400,7 +400,7 @@ class Soledad(object):
"""
# does the file exist in disk?
if not os.path.isfile(self._secrets_path):
- raise IOError('File does not exist: %s' % self._secrets_path)
+ raise IOError('File does not exist: %s' % self._secrets_path)
# read storage secrets from file
content = None
with open(self._secrets_path, 'r') as f:
@@ -431,7 +431,7 @@ class Soledad(object):
return True
except DecryptionFailed:
logger.error('Could not decrypt storage secret.')
- except IOError, e:
+ except IOError, e:
logger.error('IOError: %s' % str(e))
return False
@@ -995,8 +995,7 @@ class VerifiedHTTPSConnection(httplib.HTTPSConnection):
self.sock = ssl.wrap_socket(sock,
ca_certs=SOLEDAD_CERT,
cert_reqs=ssl.CERT_REQUIRED)
- # TODO: enable this when the certificate is fixed
- #match_hostname(self.sock.getpeercert(), self.host)
+ match_hostname(self.sock.getpeercert(), self.host)
old__VerifiedHTTPSConnection = http_client._VerifiedHTTPSConnection