python-httplib2/python-httplib2-0.9-cve-2013-2037.patch
Kevin Fenzi 2ddc623a07 - Add patch to fix http over proxy. Fixes bug #857514
- Add patch to fix CVE-2013-2037. Fixes bug #958640
- Add patch to fix binary headers in python3. Fixes bug #1205127
2015-04-03 13:26:39 -06:00

22 lines
1.1 KiB
Diff

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