Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.1k views
in Java FTP by (400 points)
Hello,

I've a process that download files from an FTP Server over SSL.

Started on Windows XP Home everything works perfectly. On Windows 2000 Server, the process always blocks at the end a the dowload. It does'nt block always at the end of the same file or after the same time.
Both works on j2sdk 1.4.0

I've tried to close the connection and reconnect after each file but it does'nt help.

Here my init code :

private void initFtp()
{
mFtp = new SSLFTPClient();
mFtp.setConfigFlags(
SSLFTPClient.ConfigFlags.DISABLE_CONTROL_WAIT_ON_CLOSE +
SSLFTPClient.ConfigFlags.DISABLE_SSL_CLOSURE +
SSLFTPClient.ConfigFlags.START_WITH_CLEAR_DATA_CHANNELS);
mFtp.setRemoteHost("ftp.xxx.xx");
mFtp.setRemotePort(990);
mFtp.setValidateServer(false);
mFtp.connect();
mFtp.auth(SSLFTPClient.AUTH_TLS);
mFtp.login(username, pwd);
mFtp.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.PASV);
mFtp.setType(FTPTransferType.ASCII);
}

and the code download:

initFtp();
mFtp.get(localFileName, fileName);
mFtp.quit();


Thx in advance for your help

Cedric

14 Answers

0 votes
by (51.2k points)
Is there any reason why you've got START_WITH_CLEAR_DATA_CHANNELS? Try it without it. If it still doesn't work then please enable logging and post the part of the log where it fails.

- Hans (EDT)
0 votes
by (400 points)
Hello,

I use START_WITH_CLEAR_DATACHANNELS because the exception "fallingback to [c]" is raised.

Here is the log. The first 4 lines comes from the log of the previous download.

Thx for your help.

Cedric

DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 13 juin 2006 11:19:05.62 : ---> QUIT
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 13 juin 2006 11:19:05.109 : 221-Goodbye. You uploaded 0 and downloaded 214 kbytes.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 13 juin 2006 11:19:05.125 : 221 Logout.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 13 juin 2006 11:19:05.140 : Closing socket on control socket

DEBUG [com.enterprisedt.net.ftp.FTPClient] 13 juin 2006 11:19:06.156 : Class: com.enterprisedt.net.ftp.ssl.SSLFTPClient
Version: 1.2.8
Build timestamp: 24-May-2006 12:04:20 EST
Java version: 1.4.0
CLASSPATH: APath\Ajar.jar
OS name: Windows 2000
OS arch: x86
OS version: 5.0

INFO [com.enterprisedt.util.license.LicenseProperties] 13 juin 2006 11:19:06.218 : Licence expiry date: 31 d
0 votes
by (51.2k points)
I'm not sure if you're aware, but START_WITH_CLEAR_DATA_CHANNELS means that your data transfers are not encrypted, so I suggest we focus on the "fallingback to [c]" exception first. Can you please describe this error, including a stack-trace and log, if possible.

- Hans (EDT)
0 votes
by (400 points)
Hello,

the error is raised by the cmd mFtp.auth(SSLFTPClient.AUTH_TLS);

Here the log and the stack.

Thx.

Cedric


INFO [com.enterprisedt.util.license.LicenseProperties] 13 juin 2006 12:09:01.100 : Licence expiry date: 31 d
0 votes
by (51.2k points)
I've searched for the "Fallback to [C]" message on the Internet and it seems that some servers, such as PureFTPD (?), do not support encryption of data transfers. This seems bizarre to me since it effectively means that attackers can't see what the name of the file you're transferring is, but they can read its contents!

Is this really what you want? If not, you should consider using a better server if possible, or otherwise contact the administrator of the server with which you're communicating.

If you're sure that you want that then we should move on to the next error. I'm thinking this could be a client-side or server-side firewall error. Do the networking environments of the two machines you're comparing differ? Also, you've crossed out the IP addresses in the log, which is understandable, but could you please check if IP address that you see on the "Connecting to" line of the log is the same as the one in the "Entering Passive Mode" line of the log.

- Hans (EDT)
0 votes
by (400 points)
Hi Bruce,

- the method SetConfigFlags takes an int as param.
- But anyway in this case, it's the same to perform a logical OR and an arithmetical +

Or do I missed something?
0 votes
by (161k points)
You're right of course - I've removed that post as it was a waste of space!

Hi Bruce,

- the method SetConfigFlags takes an int as param.
- But anyway in this case, it's the same to perform a logical OR and an arithmetical +

Or do I missed something?
0 votes
by (400 points)
HI Hans,

no I can't change the server side : it's hosted by another company, not mine.
As u say, it's really bizarre, 'cause it works really without any problem with Win XP, works for a while with Win 2000, and...stop without any reasons.

I controled the IPs which are also correct.

I'm sure that the process blocks during the download. Last time I should download a 99968 bytes file and receive only 99836 (last block left?)

Hope this help to find the solution

Thx very much for your help

Cedric
0 votes
by (161k points)
While we wait for Hans to get back to you ... because this seems to be a bizarre Windows thing, are you able to upgrade to JRE 1.4.2 or higher? That may well fix the problem.
0 votes
by (400 points)
Hello,

i've installed j2sdk1.4.2_12 and recompiled with.

Same effect on Win2000. Do I say that the jar is executed with the jsl tool in debug mode?

I'll try to do the same without it.

Categories

...