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

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