From e5098575632e9c5eaf4aba4a17cc4506196662df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Wed, 15 May 2013 17:37:44 -0300 Subject: Add hostname checking Also remove some trailing whitespace --- src/leap/soledad/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/leap/soledad') 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 -- cgit v1.2.3