Commit 8fd75343 authored by Lucas Carvalho's avatar Lucas Carvalho

Reverting partially the previous commit.

Sorry, it should not be commited in the previous commit.
parent c6f302b0
...@@ -68,12 +68,11 @@ class HTTPSConnectionCertificateVerification(httplib.HTTPSConnection): ...@@ -68,12 +68,11 @@ class HTTPSConnectionCertificateVerification(httplib.HTTPSConnection):
ca_certs=self.ssl_cert_path, ca_certs=self.ssl_cert_path,
cert_reqs=ssl.CERT_REQUIRED) cert_reqs=ssl.CERT_REQUIRED)
cert = self.sock.getpeercert() cert = self.sock.getpeercert()
if cert: for field in cert['subject']:
for field in cert['subject']: if field[0][0] == 'commonName':
if field[0][0] == 'commonName': certhost = field[0][1]
certhost = field[0][1] if certhost != self.host:
if certhost != self.host: raise ssl.SSLError(\
raise ssl.SSLError(\
"Host name '%s' doesn't match with the certificate host '%s'" "Host name '%s' doesn't match with the certificate host '%s'"
% (self.host, certhost)) % (self.host, certhost))
......
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