The problem, briefly, is that wget is sending HTTP GET commands to an
FTP server when there's a proxy server in the middle.

My .wgetrc file contains the following entries.  I've redacted all the
values, except for the port number on the FTP proxy, which seems to be
important:

ftp_proxy = ftpgate.yoyodyne.com:21
proxy_user =
proxy_passwd =
ftp_user =
ftp_passwd =

(There is some confusion on my end over the spelling of proxy_passwd
and ftp_passwd, since my first instinct was to spell them
"proxy_password" and "ftp_password".)

Here we go with invoking wget.  Again, I have redacted things like
hostnames, user names, and passwords:

wget --debug ftp://some-vendor.com/some-directory/some.pdf
DEBUG output created by Wget 1.10.2 on solaris2.9.

--12:20:20--  ftp://some-vendor.com/some-directory/some.pdf
          => `some.pdf.1'
Resolving ftpgate.yoyodyne.com... 192.168.2.4
Caching ftpgate.yoyodyne.com => 192.168.2.4
Connecting to ftpgate.yoyodyne.com|192.168.2.4|:21... connected.
Created socket 4.
Releasing 0x0005c7d0 (new refcount 1).

---request begin---
GET ftp://some-vendor.com/some-directory/some.pdf HTTP/1.0
User-Agent: Wget/1.10.2
Accept: */*
Proxy-Authorization: Basic Yadda yadda [redacted] ....=
Host: some-vendor.com

---request end---
Proxy request sent, awaiting response...
---response begin---
---response end---
200 No headers, assuming HTTP/0.9
Length: unspecified

   [         <=>                         ] 498           --.--K/s             ^

At this point the download stalls and I hit ^C.
Here are the contents of the downloaded file, "some.pdf.1":

220 Secure Gateway FTP server ready.
500 Syntax error, command unrecognized: 'GET
ftp://some-vendor.com/some-directory/some.pdf HTTP/1.0'
500 Syntax error, command unrecognized: 'User-Agent: Wget/1.10.2'
500 Syntax error, command unrecognized: 'Accept: */*'
500 Syntax error, command unrecognized: 'Proxy-Authorization: Basic
Yadda yadda [redacted] ....='
500 Syntax error, command unrecognized: 'Host: some-vendor.com'
500 Syntax error, command unrecognized: ''

I can retrieve files just fine through this proxy server using the
Solaris FTP client, which makes me think the problem is with wget.  Or
else I'm making some rookie mistake.

Reply via email to