cURL / Mailing Lists / curl-users / Single Mail


Re: Data Port connection with SSL/FTP

From: Daniel Stenberg <>
Date: Mon, 11 Dec 2006 23:45:14 +0100 (CET)

On Mon, 11 Dec 2006, wrote:

> I'm trying to make a connection and pass Data on a certain port (range of
> 20050 - 20750).

curl has no option to control what port number the data connection will open
and listen to for the PORT command.

> C:\Temp>curl --ftp-ssl -u UCE0933A:1GNNPRTS --use-ascii --ftp-port -
> --local-port 20049-20750 --trace-ascii teresa.out

This has two problems:

1) --local-port is the local end of all outgoing TCP connections. It is not
    the port number to use when it expects the server to connect back.

2) --ftp-port tells the server to use the default, which in your case seems to
    pick a private network one which just can't be right.

> == Info: About to connect() to port 20021
> == Info: Trying == Info: Local port: 20049

See, it set a local port from your selected port range.

> == Info: Telling server to connect to
> => Send header, 26 bytes (0x1a)
> 0000: PORT 192,168,1,149,9,217

192.168.* are private ones, so any external host will simply not be able to
reach you on that address.

Also, note that you have now published your user name and password to the
entire world, so I hope they were fakes or that you've already changed them.

  Commercial curl and libcurl Technical Support:
Received on 2006-12-11