Commit c6f302b0 authored by Lucas Carvalho's avatar Lucas Carvalho

Typo.

parent 68f4c30a
......@@ -68,11 +68,12 @@ class HTTPSConnectionCertificateVerification(httplib.HTTPSConnection):
ca_certs=self.ssl_cert_path,
cert_reqs=ssl.CERT_REQUIRED)
cert = self.sock.getpeercert()
for field in cert['subject']:
if field[0][0] == 'commonName':
certhost = field[0][1]
if certhost != self.host:
raise ssl.SSLError(\
if cert:
for field in cert['subject']:
if field[0][0] == 'commonName':
certhost = field[0][1]
if certhost != self.host:
raise ssl.SSLError(\
"Host name '%s' doesn't match with the certificate host '%s'"
% (self.host, certhost))
......@@ -90,7 +91,7 @@ class VerifiedHTTPSHandler(urllib2.HTTPSHandler):
def install_opener_director(info_dict):
if info_dict.get('schema') in ('https',):
if info_dict.get('scheme') in ('https',):
https_handler = VerifiedHTTPSHandler()
url_opener = urllib2.build_opener(https_handler)
urllib2.install_opener(url_opener)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment