B
Barney
Hi,
I'm having problems using the Apache Commons FTPClient to connect to an
external FTP site through a firewall:
System.setProperty("socksProxyHost", proxyUrl);
System.setProperty("socksProxyPort", proxyPort);
FTPClient ftp = new FTPClient();
try {
ftp.connect(url);
...
When I run this, the whole thing just hangs. However, using a
standalong FTP client (SmartFTP) configured with the same settings
works fine.
Using Ethereal, I had a look at the network traffic. The SmartFTP
session connects directly using SOCKS4, whereas the java session first
tries SOCKS5 and then falls back to SOCKS4. This all looks fine. This
level of detail is all getting a bit beyond me, but the problem appears
to be in the SOCKS connection packet being sent.
Successful connection:
Frame 4 (63 bytes on wire, 63 bytes captured)
Ethernet II, Src: 00:0d:56:c5:6c:27, Dst: 00:00:5e:00:01:02
Internet Protocol, Src Addr: <local.ip.address>, Dst Addr:
<proxy.ip.address>
Transmission Control Protocol, Src Port: 4313 (4313), Dst Port: 1080
(1080), Seq: 1, Ack: 1, Len: 9
Socks Protocol
Version: 4
Command: 1 (Connect)
Remote Port: 21
Remote Address: <external.ftp.server>
User Name:
Unsuccessful connection:
Frame 4 (55 bytes on wire, 55 bytes captured)
Ethernet II, Src: 00:0d:56:c5:6c:27, Dst: 00:00:5e:00:01:02
Internet Protocol, <local.ip.address>, Dst Addr: <proxy.ip.address>
Transmission Control Protocol, Src Port: 4600 (4600), Dst Port: 1080
(1080), Seq: 1, Ack: 1, Len: 1
Socks Protocol
Version: 5
[Unreassembled Packet (incorrect TCP checksum): Socks]
Of course, this could all just be an Ethereal problem.
Either way, does anyone have any idea what is going wrong here, and how
I can fix it?
Running on Windows XP Pro
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
Thanks,
Barney
I'm having problems using the Apache Commons FTPClient to connect to an
external FTP site through a firewall:
System.setProperty("socksProxyHost", proxyUrl);
System.setProperty("socksProxyPort", proxyPort);
FTPClient ftp = new FTPClient();
try {
ftp.connect(url);
...
When I run this, the whole thing just hangs. However, using a
standalong FTP client (SmartFTP) configured with the same settings
works fine.
Using Ethereal, I had a look at the network traffic. The SmartFTP
session connects directly using SOCKS4, whereas the java session first
tries SOCKS5 and then falls back to SOCKS4. This all looks fine. This
level of detail is all getting a bit beyond me, but the problem appears
to be in the SOCKS connection packet being sent.
Successful connection:
Frame 4 (63 bytes on wire, 63 bytes captured)
Ethernet II, Src: 00:0d:56:c5:6c:27, Dst: 00:00:5e:00:01:02
Internet Protocol, Src Addr: <local.ip.address>, Dst Addr:
<proxy.ip.address>
Transmission Control Protocol, Src Port: 4313 (4313), Dst Port: 1080
(1080), Seq: 1, Ack: 1, Len: 9
Socks Protocol
Version: 4
Command: 1 (Connect)
Remote Port: 21
Remote Address: <external.ftp.server>
User Name:
Unsuccessful connection:
Frame 4 (55 bytes on wire, 55 bytes captured)
Ethernet II, Src: 00:0d:56:c5:6c:27, Dst: 00:00:5e:00:01:02
Internet Protocol, <local.ip.address>, Dst Addr: <proxy.ip.address>
Transmission Control Protocol, Src Port: 4600 (4600), Dst Port: 1080
(1080), Seq: 1, Ack: 1, Len: 1
Socks Protocol
Version: 5
[Unreassembled Packet (incorrect TCP checksum): Socks]
Of course, this could all just be an Ethereal problem.
Either way, does anyone have any idea what is going wrong here, and how
I can fix it?
Running on Windows XP Pro
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
Thanks,
Barney