cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ftp-ssl

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 4 Apr 2007 09:53:18 -0700

On Wed, Apr 04, 2007 at 10:56:14AM -0400, Dorr, Brad wrote:
> I am trying to connect to a secure FTP server and get a listing of files. It
> connects on port 21 and passes in login info just fine. But then when it goes
> into passive mode another address is passed back that curl and curl to tries to
> connect to it. I used the option ?ftp-skip-pasv-ip option to tell it to ignore
> the new IP address, which worked. It now reverts back and uses the orig IP
> ,but then it just hangs because it needs to switch to port 1024 and I am
> guessing it is trying to still use port 21. That is just a guess.
[...]
> We are using 7.15.1 version of curl.

A lot has changed since then.

> curl --ftp-ssl -1kvu ID:PSWD ftp://IPADDRESS --ftp-skip-pasv-ip -Q "PASV"

You're sending a quoted PASV command, which is probably the problem here.

> > PWD
>
> < 257 "/users/PHNS" is current directory
>
> * Entry path is '/users/PHNS'
>
> > PASV
>
> < 227 Entering Passive Mode (2NDIPADDRESS,4,0).

This is curl sending PASV on its own. It stores this address and port number
for the transfer to come.

> > EPSV
>
> * Connect data stream passively
>
> < 500 illegal command
>
> * disabling EPSV usage
>
> > PASV
>
> < 227 Entering Passive Mode (2NDIPADDRESS,4,1).

This is your quoted PASV command. curl sends this blindly, and I doubt
it saves this address and port number.

> * Skips 2NDIPADDRESS for data connection, uses IPADDRESS instead
>
> * Trying IPADDRESS... A remote host did not respond within the timeout
> period.
>
> * Trying IPADDRESS... A remote host did not respond within the timeout
> period.
>
> * couldn't connect to host

This is curl trying to connect to the hose, likely on the port number given
on the *first* PASV command. The remote host likely closed this port
when it received the second PASV.

>
> * Connection #0 to host IPADDRESS left intact
>
> curl: (7) couldn't connect to host
>
> * Closing connection #0
>
> Segmentation fault(coredump)

This should *never* happen. Does a more recent curl version core dump as
well?

>>> Dan

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