httplib2
httplib2 copied to clipboard
fix SSL problem
fix issue 173. originated by kvvier(https://code.google.com/u/kvvier/) and verified for python3.3 (win) by (https://code.google.com/u/111191101025126589579/), and me for python3.4 (linux)
As the modification of !disable_ssl_certificate_validation, I got following error when I try to install: byte-compiling build/bdist.linux-armv7l/egg/httplib2/init.py to init.cpython-34.pyc File "build/bdist.linux-armv7l/egg/httplib2/init.py", line 829 check_hostname=!disable_ssl_certificate_validation) ^ SyntaxError: invalid syntax
So I suggest the change kvvier
I get this error on Python3.3:
Traceback (most recent call last):
File "lsftest.py", line 13, in <module>
header, contents = h.request(url)
File "C:\Python33\lib\site-packages\httplib2\__init__.py", line 1174, in request
self.disable_ssl_certificate_validation)
File "C:\Python33\lib\site-packages\httplib2\__init__.py", line 829, in __init__
check_hostname=True)
File "C:\Python33\lib\http\client.py", line 1183, in __init__
raise ValueError("check_hostname needs a SSL context with "
ValueError: check_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED
(stripped) code:
h = httplib2.Http(".cache", disable_ssl_certificate_validation=True)
header, contents = h.request("https://...")
So suppose line 229 has to be:
check_hostname=ssl.CERT_OPTIONAL if disable_ssl_certificate_validation else ssl.CERT_REQUIRED)
Is there any chance that we get a fix for that issue merged?
There is also https://github.com/jcgregorio/httplib2/pull/289 , which attributes the original author.