cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ftp over proxy using the PORT command

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 9 Jul 2008 21:22:33 -0700

On Wed, Jul 09, 2008 at 11:18:36PM -0400, DUIMSTRA, THOMAS J (TOM), ATTSI wrote:
> Trying to upload to some ftp server over a proxy.
>
> /usr/local/bin/curl -v -P - -p -T tom.txt -x {proxy:port} --trace
> tom.out "ftp://{userid}:{password}@{ftp-server}/path/to/upload/dir/"
>
>
> The ftp-server that I'm attempting to upload to does not support PASV,
> which is why I'm attempting the PORT cmd (-P).
> Just not sure why I'm getting the "Illegal PORT command". Does it have
> something to do with my proxy server?

I don't see how -P could possibly work through a proxy tunnel. The
remote ftp server will in that case attempt to directly connect to the
client machine, bypassing the proxy altogether, and the client won't be
expecting a connection. Unless curl deliberately bypasses the proxy in
this case... Still, the reason you're using a proxy server is probably
because the client machine is not directly accessible to the remote
ftp server.

> Here is the content of tom.out - I've modified it for readability...
>
> == Info: About to connect() to {proxy:port}
> == Info: Connected {proxy} (proxy IP Address) {proxy port}
> == Info: Establish HTTP proxy tunnel to {ftp-server}:21
>
>
> CONNECT {ftp-server}:21 HTTP/1.0..User-Agent: curl/7.9.8 (
> hppa2.0n-hp-hpux 11.00) libcurl 7.9.8 (OpenSSL 0.9.6d)....

It's almost not worth commenting on a 6 year old version of curl.

> 250 Directory successfully changed...
> == Info: We connect from {client-name}
> PORT aaa,bbb,cc,dd,208,217.. {aaa,bbb,cc,dd is the IP address of my
> client from which I ran the curl command}
> 500 Illegal PORT command...

It looks like either the server doesn't support PORT (which you say isn't
the case) or the address argument points to an IP range that the server
knows is invalid and therefore refuses to accept it.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-10