httplib2 icon indicating copy to clipboard operation
httplib2 copied to clipboard

fix SSL problem

Open gcd0318 opened this issue 10 years ago • 3 comments

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

gcd0318 avatar Jun 11 '14 18:06 gcd0318

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)

FichteFoll avatar Jul 05 '14 00:07 FichteFoll

Is there any chance that we get a fix for that issue merged?

maweki avatar Mar 12 '15 14:03 maweki

There is also https://github.com/jcgregorio/httplib2/pull/289 , which attributes the original author.

jayvdb avatar Apr 28 '15 15:04 jayvdb