Closed Bug 33122 Opened 24 years ago Closed 24 years ago

Can't download FTP file through proxy

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: the-enigman, Assigned: mozilla)

References

()

Details

(Whiteboard: [nsbeta3+])

Overview Description:
Downloading a file from an FTP server doesn't work through proxy server.

Steps to Reproduce:
1) Load URL on Mozilla using an FTP proxy
2) Attempt to download the file vpdchk.exe

Actual Results:
An "Unknown Error" message appears

Expected Results:
file should download, as it does with IE

Build Date & Platform Bug Found:
2000032210, Win98

Additional Builds and Platforms Tested On:
none

Additional Information:
This is likely related to the Passive FTP which was also used by previous
Netscape versions and is described in
http://help.netscape.com/kb/consumer/19960513-36.html. Since IE works in this
situation, it would be worthwile to fix this.
->jud
Assignee: gagan → valeski
the-enigman@home.com - I don't have an FTP proxy. Are you still seeing this 
problem with recent builds of Mozilla?

Gerv
With the 200051012/Win98 build, executing the same steps, the error message no 
longer appears...in fact nothing happens at all after you click on the 
vpdchk.exe link...this occurs on other links to FTP downloads as well. The 
console window doesn't show any messages either. I'm not sure if that's another 
bug or if it's related to this one.
Confirming for investigation.

Gerv
Status: UNCONFIRMED → NEW
Ever confirmed: true
seeing the same thing on NT 2000051808
*** Bug 40399 has been marked as a duplicate of this bug. ***
This bug occurs in 2000061311 too. Mozilla does not even contact proxy (i
checked access logs of my proxy). in my case ftp works only when "Direct
connection to the internet" is checked. Setting proxy for HTTP, and leaving
blank fields for ftp doesn't help.
*** Bug 42626 has been marked as a duplicate of this bug. ***
I think this bug is really nasty for users with proxy, shouldn't it be fixed soon?
*** Bug 43110 has been marked as a duplicate of this bug. ***
*** Bug 46241 has been marked as a duplicate of this bug. ***
Possibly useful additional information:

We have Microsoft Proxy Server 2.0 (blech) here, and it is too braindead to use
Proxy-Authenticate; rather, it uses WWW-Authenticate to authenticate proxy
requests.  It might be interesting to see what others' proxies do if they telnet
to them and issue a HEAD request for a site, like this (testers need to key in
the HEAD line, the Host: line, and one additional blank line):

$ telnet proxyhost 80
Trying 1.2.3.4...
Connected to proxyhost.
Escape character is '^]'.
HEAD / HTTP/1.1
Host: www.microsoft.com

HTTP/1.1 401 Access Denied
WWW-Authenticate: Basic realm="www.microsoft.com"
Connection: close
Content-Length: 644
Content-Type: text/html

Connection closed by foreign host.
*** Bug 47271 has been marked as a duplicate of this bug. ***
*** Bug 43110 has been marked as a duplicate of this bug. ***
I can't believe it's still open. happens on netscape proxies as well. Without 
that feature mozilla will be dead.
nom beta3 and over to gagan
Assignee: valeski → gagan
Keywords: nsbeta3
robert-- welcome to necko!
Assignee: gagan → rjc
FWIW, when I type a ftp URL in the address bar, the console says:

###!!! ASSERTION: NS_ENSURE_TRUE(NS_SUCCEEDED(DoURILoad(aURI, aReferrer, aOwner,
loadCmd, aWindowTarget, aPostData))) failed: '(!((DoURILoad(aURI, aReferrer,
aOwner, loadCmd, aWindowTarget, aPostData)) & 0x80000000))', file
nsDocShell.cpp, line 2748
###!!! Break: at file nsDocShell.cpp, line 2748
###!!! ASSERTION: NS_ENSURE_TRUE(NS_SUCCEEDED(LoadURI(uri, 0))) failed:
'(!((LoadURI(uri, 0)) & 0x80000000))', file nsDocShell.cpp, line 1348
###!!! Break: at file nsDocShell.cpp, line 1348

I'm using Mozilla from CVS August 7th 2000 on Linux 2.2; the proxy is squid.

Hope this helps.
This is blocking me at work. Need this fixed and will provide my own resources
to help, if necessary.

This better get nominated nsbeta3+ because this is a VERY necessary feature.
*** Bug 48638 has been marked as a duplicate of this bug. ***
*** Bug 48591 has been marked as a duplicate of this bug. ***
Per triage team, got to get FTP working thru proxies. 
Whiteboard: [nsbeta3+]
*** Bug 49807 has been marked as a duplicate of this bug. ***
Umm...THIS wouldn't be the problem, would it? :

From mozilla/netwerk/base/src/nsProtocolProxyService.cpp

283 if (mFTPProxyHost != "" && mFTPProxyPort > 0 && 284 !PL_strcasecmp(scheme,
"ftp")) {
285 rv = aProxy->SetProxyHost(mFTPProxyHost);
286 if (NS_FAILED(rv)) return rv;
287 aProxy->SetProxyType("http");  <---- Should that be ftp?
288 return aProxy->SetProxyPort(mFTPProxyPort);
289 }

I wonder if that's all it is. I'll take a closer look at aProxy->SetProxyType.
Ok, it's not. in mozilla/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp:

190 nsCOMPtr<nsIChannel> proxyChannel;
191 // if an FTP proxy is enabled, push things off to HTTP.

That would explain why the type is set to "http". BUT..I also noticed this:

187 useProxy = PR_FALSE;
188 if (NS_SUCCEEDED(channel->GetUsingProxy(&useProxy)) && useProxy) {
(The proxy code comes after that point.)

Unless channel->GetUsingProxy(&useProxy) changes the value of useProxy, then I
think that someone hardcoded ftp proxying to be OFF. (GRRRR)

Let me do some more digging.
Ok, it's not that either, it's turned back on in
704 NS_IMETHODIMP 705 nsFTPChannel::GetUsingProxy(PRBool *aUsingProxy)
706 {
707 if (!aUsingProxy)
708 return NS_ERROR_NULL_POINTER;
709 *aUsingProxy = (!mProxyHost.IsEmpty() && !mProxyTransparent);
710 return NS_OK;
711 }

So I guess I'm going to have to dig deep into the HTTP Proxying code.

See verified invalid bug 37366: "access through a squid proxy fails for ftp"
and recent new bug 50353: "Browser is not able to load ftp site"
Hmm... I've looked at the bug 37366 and the ftp access throug proxy doesn't work
although I set the proxy.keep_alive to true and http.version to 1.0. I think
it's definitely bug in Mozilla. Please fix it !!!! :-(((
I've reopened bug 37366. It does NOT work for me.
Blocks: 50353
On Linux I can do "tcpdump -i lo" to snoop the loopback interface and I see
absolutely no packets when Mozilla is set for ftp proxying. There are plenty of packets
on direct ftp.

It's not doing anything at all.
I forgot to add that I'm using a squid proxy on localhost.
*** Bug 50353 has been marked as a duplicate of this bug. ***
Fixed.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Adding bug# 37366 as a dependency. ("Cannot download ftp file through squid
proxy") since it had a bunch of comments that might be relevant to this bug.

If this bug is really fixed (I still see it in build 2000090608, but that was
probably built before the fix was checked in), then we can probably consider
37366 fixed as well.
Depends on: 37366
Wow! Finally! I'm so happy that this bug is now fixed!!! :-))))))))))))))
verified:
Win NT 2000090808
Status: RESOLVED → VERIFIED
I'm not going to reopen this just yet, because I'm not sure if this qualifies as 
the same bug or should be filed as an another bug.  Advice welcome.

In 2000091008 (Win32), Moz is now trying to use my proxy server but does not 
prompt for a username and password when the proxy server returns a 407.  (By 
contrast, if an HTTP request is made, the username and password is prompted for 
by Moz.)
*** Bug 52543 has been marked as a duplicate of this bug. ***
*** Bug 52543 has been marked as a duplicate of this bug. ***
I have opened bug 52615 for the issue with proxy servers that require
authentication.
You need to log in before you can comment on or make changes to this bug.