[ python-Bugs-913619 ] httplib: HTTPS does not close() connection properly

SourceForge.net noreply at sourceforge.net
Wed Mar 10 12:00:17 EST 2004


Bugs item #913619, was opened at 2004-03-10 12:00
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913619&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: rick (sf_rick)
Assigned to: Nobody/Anonymous (nobody)
Summary: httplib:  HTTPS does not close() connection properly

Initial Comment:
When looping through requests to an HTTP server close()
closes out the active connection.  An the second loop
through a new HTTP connection is created.

When looping through requests to an HTTPS server
close() does not close the connection.  It keeps it
active.  On the second pass through the loop
httplib.HTTPS uses the previously initiated connection.
 Shouldn't close() close out the connection as it does
for the HTTP connection?

sample code to illustrate:

def getdata(): 
    params = urllib.urlencode({'username': 'test',
'password': 'test'})
    h = httplib.HTTPS(host = "test.site.com", port =
443, key_file = "fake.pem", cert_file = "fake.pem")
    h.putrequest('POST', '/scripts/cgi.exe?')
    h.putheader('Content-length', '%d'%len(params))
    h.putheader('Accept', 'text/plain')
    h.putheader('Host', 'test.site.com')
    h.endheaders()
    h.send(params)
    reply, msg, hdrs = h.getreply()
    data = h.getfile().read()
    file('test.file', 'w').write(data)
    h.close()
    


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=913619&group_id=5470



More information about the Python-bugs-list mailing list