cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTPS connections closing after single request

From: Albert Strasheim <fullung_at_gmail.com>
Date: Fri, 11 Mar 2005 16:42:52 +0200

Hello all,

I am using pycurl-ssl 7.13.0 on Windows Server 2003 with Python 2.4.

I am having problems with libcurl closing HTTPS connections after
processing a single request.

The code:

import pycurl
def body(buf):
    pass
pycurl.global_init(pycurl.GLOBAL_ALL)
c = pycurl.Curl()
# disable SSL verification because server certs are messed up
c.setopt(pycurl.SSL_VERIFYPEER, 0)
c.setopt(pycurl.SSL_VERIFYHOST, 0)
c.setopt(pycurl.VERBOSE, 1)
c.setopt(pycurl.URL, "https://fw.sun.ac.za:950/")
c.setopt(pycurl.WRITEFUNCTION, body)
c.setopt(pycurl.FRESH_CONNECT, 0)
c.setopt(pycurl.MAXCONNECTS, 10)
c.perform()
c.perform()
c.close()
pycurl.global_cleanup()

I get:

* About to connect() to fw.sun.ac.za port 950
* Trying 146.232.128.17... * connected
* Connected to fw.sun.ac.za (146.232.128.17) port 950
* SSL connection using DES-CBC3-SHA
* Server certificate:
<snip>
* SSL certificate verify result: error number 1 (20), continuing anyway.
> GET / HTTP/1.1
Host: fw.sun.ac.za:950
Pragma: no-cache
Accept: */*

< HTTP/1.0 200 OK
< Content-type: text/html
< Pragma: no-cache
< Cache-Control: no-cache
* Closing connection #0
* About to connect() to fw.sun.ac.za port 950
* Trying 146.232.128.17... * connected
* Connected to fw.sun.ac.za (146.232.128.17) port 950
* SSL re-using session ID
* SSL connection using DES-CBC3-SHA
* Server certificate:
<snip>
* SSL certificate verify result: error number 1 (20), continuing anyway.
> GET / HTTP/1.1
Host: fw.sun.ac.za:950
Pragma: no-cache
Accept: */*

< HTTP/1.0 200 OK
< Content-type: text/html
< Pragma: no-cache
< Cache-Control: no-cache
* Closing connection #0

As can be seen from this output, the connection is closed once the
result for the GET is received, but the server doesn't send a
Connection: close request or anything of that nature.

This seems to happen regardless of the FRESH_CONNECT and MAXCONNECTS
settings (i.e. I couldn't find values that make any difference).

Is there any way I can find out why libcurl is doing this? It might be
that the server is closing the connection instead of curl, but that is
unlikely. Is there any way I can find out which side closed the
connection?

The problem seems to be related to the thread starting here:

http://curl.haxx.se/mail/lib-2002-03/0154.html

However, I didn't see anything in there that seemed relevant to my problem.

Thanks.

Regards,

Albert Strasheim
Received on 2005-03-11