Python2.4 and HTTPS

Good Z goodz158 at
Sun Apr 5 09:17:33 CEST 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')

r1 = conn1.getresponse()

data1 =
print data1

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\", line 928, in getresponse
  File "C:\Python25\lib\", line 385, in begin
    version, status, reason = self._read_status()
  File "C:\Python25\lib\", line 349, in _read_status
    raise BadStatusLine(line)

Any help would be appreciated.

Best Regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list