Multple HTTPS requests over the same socket

Martin v. Loewis martin at v.loewis.de
Fri Mar 1 18:51:38 EST 2002


"Chad Maine" <chad.maine at broadlink.com> writes:

> I have class that opens an SSL socket to an HTTPS server in it's
> __init__.  I then call a class method to send the headers and make
> the request ( a 'POST') and return the results.  If I try to use
> that same SSL socket again for another request, I get nothing.  Is
> what I'm trying to possible or do I need to close the socket and
> open another?

At a minimum, it depends on the protocol you are using. You need to
use HTTP/1.1., and post a Connection: Keep-alive header, otherwise the
server will close the socket. The server may still close the
connection even if you request that it be kept alive.

Regards,
Martin




More information about the Python-list mailing list