cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: List command hangs in passive mode

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 8 Apr 2008 21:25:58 -0700

On Tue, Apr 08, 2008 at 07:08:27PM -0700, Edward Lau wrote:
> I am having a great deal of trouble trying to connect using curl and I'm hoping
> someone can help me understand what is going on. I am trying to connect to a
> server using FTP over explicit TLS/SSL. The remote server uses a data port
> range of 6100-6199. The network people assure me that the firewall is opened to
> allow outgoing connections to those ports. Any commands in PASV mode including
> RETR and LIST seem to time out. The network guy says there is no connection
> trying to leave my server.
>
> Below is my log. I'd greatly appreciate any help you could give.

I don't even need to see the log--the answer is here:

> % curl --user XXX:XXX --cacert cacert.pem --tlsv1 --disable-epsv --ftp-ssl-reqd
> --show-error --verbose -Q "CWD outbound/BTBT" -Q "TYPE I" -Q PASV -Q LIST ftp:/
> /ftpssl.rbc.com

Trying to do things like PASV and LIST through quote commands just isn't
going to work. They put the remote server into a state that's inconsistent
with what curl thinks it is, since it just passes quote commands blindly to
the remote side. curl already takes care of all those commands as part
of a normal transfer.

You probably want a command more like:

  curl --user XXX:XXX --cacert cacert.pem --tlsv1 --disable-epsv \
  --ftp-ssl-reqd --show-error --verbose \
  'ftp://ftpssl.rbc.com/outbound/BTBT/'

If you look at the verbose logs, you'll see curl doing the CWD, TYPE, PASV,
and LIST commands on its own.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-04-09