cURL / Mailing Lists / curl-users / Single Mail

curl-users

ftps hangs

From: Robert Bednar <boborama_at_embarqmail.com>
Date: Thu, 3 Feb 2011 01:44:47 -0500

I'm moving everything from ftp to "secure ftp" and updating my curl using scripts (simple ksh or bash scripts) to use ftps.

My first script update (script SENDS a file) proved it was very easy to update to ftps.
My second update did not go so well. It prompts the user for a file to RECEIVE. I do this be getting a directory LIST and prompting the user.
My troubleshooting has revealed that while I can RECEIVE a file via FTPS, I'm not able to return a simple directory LIST

I moved my examples to the command line. I can see where the directory list DOES come back.... but them Curl hangs....and never returns to the shell with an exit code.
I've tried various options to force different modes --disable-epsv or passive mode...connection time outs....maximum connect time etc. I tried listing very long directories that
require several "packets" as seen in the trace log...and the entire directory listing comes through perfectly....and then hangs when Curl should be setting an exit code.

It shouldn't be a firewall or port issue...because I am able to transfer files. Also very peculiar.... using the TRACE command on one test directory I found that if I truncate the data stream by even 1 byte.... the command terminates normally with exit code "0" . The length of my directory is 135 characters (and terminates with CR/LF)

Example: The following command works perfectly and terminates normally.
./curl -k --ftp-ssl ftp://usr:password@123.456.78.9:990//mydir/tmp/12345/test/ --range 0-134

Example: The following command seems to hang indefinitely
./curl -k --ftp-ssl ftp://usr:password@123.456.78.9:990//mydir/tmp/12345/test/ --range 0-135

Trace and Verbose isn't really helping. Everything looks fine....right up to the point where the listing has completed and it just hangs inexplicably.

Why would changing the range by one byte cause the command to hang? I tried setting ranges larger than the expected stream...they hang as well with ftps, but work fine on "non-secure" ftp. Strangely this problem seems to manifest itself on my Fedora 10 system. I've tried Curl 1.16.x -- Curl 1.19.x and now....a build of the most recent 1.21.3 all to no avail. My other systems (Redhat 9 based) are running either curl 1.14 to 1.15 and do not experience the problem. I've yet to get a newer build on one of those systems for a "same version" comparison...though reportedly they function perfectly under 1.21.3.

So.... what's up with my Fedora box that makes getting a simple LIST from Curl problematic? Something with my ssl libraries? Something with my certificate? I don't think I'm even using any certificate authentication (-k option) . I'm calling out to the community for help.

Thanks.

 
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-03