cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL FTP upload through firewall

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 19 Nov 2001 23:28:52 +0100 (MET)

On Mon, 19 Nov 2001, Sebastian Gibbs wrote:

> Basically having problems FTPing through a firewall. I think it's because
> it's attempting to communicate through an additional port other than port
> 21.

There are many kinds of firewalls and firewall setups, but it generally means
that it is still safe to use PASV (and that's also why curl defaults to
PASV). Using PORT through a firewall forces the firewall to detect and
understand FTP to allow the reversed connection back that PORT implies.

> I don't quite understand the -P switch, do I give the IP of the internet
> gateway.

-P should normally be used like I wrote before "-P -" as that picks the
default IP. It should be the IP address which you want the remote server to
use when it contacts you (as that is what the PORT command tells the server).

> curl --v -T c:\test.txt
> ftp://username:password@upload.internetsite.com/afolder/
>
> < 220 ispdetails Microsoft FTP Service (Version 4.0).
> > User username
> ..then hangs

This is a major problem that I really can't see what curl can do better.
After 'USER' is sent, curl expects a 331 reply that requests s password. Or a
200-code for success, or a 530 for access denied. Just not replying anything
doesn't seem correct.

> (I can access the FTP area using IE.)

That certainly makes things really weird. Are you possibly using a proxy with
the browser?

Can you run a network sniffer to find out what commands IE sends that succeed
when curl's commands don't?

In fact, what happens when you run your plain 'ftp' command from a shell? Use
-d for debugging info, and show us the output.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-11-19