Blame SOURCES/python-httplib2-0.9-cve-2013-2037.patch

d5958a
diff -Nur httplib2-0.9.orig/python2/httplib2/__init__.py httplib2-0.9/python2/httplib2/__init__.py
d5958a
--- httplib2-0.9.orig/python2/httplib2/__init__.py	2015-04-03 13:10:43.401035131 -0600
d5958a
+++ httplib2-0.9/python2/httplib2/__init__.py	2015-04-03 13:10:08.470685647 -0600
d5958a
@@ -1042,7 +1042,7 @@
d5958a
                         raise CertificateHostnameMismatch(
d5958a
                             'Server presented certificate that does not match '
d5958a
                             'host %s: %s' % (hostname, cert), hostname, cert)
d5958a
-            except ssl_SSLError, e:
d5958a
+            except (ssl_SSLError, CertificateHostnameMismatch), e:
d5958a
                 if sock:
d5958a
                     sock.close()
d5958a
                 if self.sock:
d5958a
@@ -1052,7 +1052,7 @@
d5958a
                 # to get at more detailed error information, in particular
d5958a
                 # whether the error is due to certificate validation or
d5958a
                 # something else (such as SSL protocol mismatch).
d5958a
-                if e.errno == ssl.SSL_ERROR_SSL:
d5958a
+                if hasattr(e, 'errno') and e.errno == ssl.SSL_ERROR_SSL:
d5958a
                     raise SSLHandshakeError(e)
d5958a
                 else:
d5958a
                     raise