1 |
diff -r 93291649202b python2/httplib2/__init__.py |
2 |
--- a/python2/httplib2/__init__.py Tue Mar 26 14:17:48 2013 -0400 |
3 |
+++ b/python2/httplib2/__init__.py Tue Apr 23 10:32:15 2013 +0300 |
4 |
@@ -1030,7 +1030,7 @@ |
5 |
raise CertificateHostnameMismatch( |
6 |
'Server presented certificate that does not match ' |
7 |
'host %s: %s' % (hostname, cert), hostname, cert) |
8 |
- except ssl_SSLError, e: |
9 |
+ except (ssl_SSLError, CertificateHostnameMismatch), e: |
10 |
if sock: |
11 |
sock.close() |
12 |
if self.sock: |
13 |
@@ -1040,7 +1040,7 @@ |
14 |
# to get at more detailed error information, in particular |
15 |
# whether the error is due to certificate validation or |
16 |
# something else (such as SSL protocol mismatch). |
17 |
- if e.errno == ssl.SSL_ERROR_SSL: |
18 |
+ if hasattr(e, 'errno') and e.errno == ssl.SSL_ERROR_SSL: |
19 |
raise SSLHandshakeError(e) |
20 |
else: |
21 |
raise |