Bug (?) in httplib SSL

Jonathan Hseu vomjom at vomjom.org
Fri Apr 19 06:24:07 EDT 2002


I'm not quite sure whether this is a bug, or it's just my fault.
Basically, when I try a POST over SSL on an IIS server, it hangs.

I am using Python 2.2.1, and here is the relevant code:
	params = urllib.urlencode(account)
	headers = {"Content-type": "application/x-www-form-urlencoded",
		   "Accept": "text/plain"}
	connection = httplib.HTTPSConnection(server)
	connection.set_debuglevel(1)
	connection.request("POST", "/LoginPost.asp", params, headers)
	response = connection.getresponse()

It hangs there, here's the traceback:
Traceback (most recent call last):
  File "./smote.py", line 37, in ?
    smote()
  File "./smote.py", line 30, in smote
    response = connection.getresponse()
  File "/usr/lib/python2.2/httplib.py", line 591, in getresponse
    response = self.response_class(self.sock, self.debuglevel)
  File "/usr/lib/python2.2/httplib.py", line 99, in __init__
    self.fp = sock.makefile('rb', 0)
  File "/usr/lib/python2.2/httplib.py", line 628, in makefile
    buf = self.__ssl.read()

I've been looking through old bug reports, and there was one that I was
receiving earlier (until I upgraded).  The reason people received this
bug was apparently because some web servers, such as IIS, don't complete
the SSL connection before they close it.

Perhaps that is the problem?

By the way, I am not subscribed, so please e-mail me directly.
Thank you.

-- 
Jonathan Hseu <vomjom at vomjom.org, vomjom at debian.org, jh4 at cec.wustl.edu>
GPG ID:          5228D713
GPG fingerprint: 220B A4EF 70FE B884 CB38  F93F EA8A 1024 5228 D713





More information about the Python-list mailing list