Python2.4 and HTTPS

Good Z goodz158 at yahoo.com
Sun Apr 5 03:17:33 EDT 2009


Dear all, 
I am using Python 2.4.3 for my project. We need to use HTTPS with python2.4.3 unfortunately it seems httplib is not working fine for me. Below is small code that works well with Python2.6.1 but not with Python2.4.3. Unfortunately its not possible for me to move away from Python 2.4.3. Would request if anyone has any idea how to make this programs work in Python2.4.3.

import httplib
conn1 = httplib.HTTPSConnection(WEBSITE_ADDRESS)
conn1.putrequest('GET', RELATIVE_ADDR)
conn1.putheader('Connection', 'close')
conn1.endheaders()

r1 = conn1.getresponse()

data1 = r1.read()
print data1
conn1.close()

One executing the above program, it crash while reading the response and gives following error:
Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    r1 = conn1.getresponse()
  File "C:\Python25\lib\httplib.py", line 928, in getresponse
    response.begin()
  File "C:\Python25\lib\httplib.py", line 385, in begin
    version, status, reason = self._read_status()
  File "C:\Python25\lib\httplib.py", line 349, in _read_status
    raise BadStatusLine(line)
BadStatusLine

Any help would be appreciated.

Best Regards,
Mike.



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090405/7f06963e/attachment.html>


More information about the Python-list mailing list