Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
14.5k views
in Java FTP by (480 points)
Hi,
I am using Edit FTP pro to connect to a vendor FTP site using Implicit FTPS. I am trying to put a file. I have verified that the file is getting to it's destination correctly, but I am getting the following error on the FTP client site

java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.net.SocketInputStream.read(SocketInputStream.java:193)
at java.io.FilterInputStream.read(FilterInputStream.java:77)
at java.io.PushbackInputStream.read(PushbackInputStream.java:133)
at com.enterprisedt.net.puretls.N.A(Unknown Source)
at com.enterprisedt.net.puretls.I.A(Unknown Source)
at com.enterprisedt.net.puretls.Y.A(Unknown Source)
at com.enterprisedt.net.puretls.r.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:452)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:494)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:222)
at java.io.InputStreamReader.read(InputStreamReader.java:177)
at java.io.BufferedReader.fill(BufferedReader.java:147)
at java.io.BufferedReader.readLine(BufferedReader.java:310)
at java.io.BufferedReader.readLine(BufferedReader.java:373)
at com.enterprisedt.net.ftp.FTPControlSocket.E(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.put(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.put(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.put(Unknown Source)
..................................................

After having gone through your forums I came across the SSLFTPClient.ConfigFlags.DISABLE_SSL_CLOSURE flag.
I have used that flag as suggested, but I was still getting same exception. So, I increased the timeout value as follows, to see if timeout is an issue.
ftp.setTimeout( 180000 );

Now I am getting the following exception.

com.enterprisedt.net.puretls.SSLPrematureCloseException: Short read
at com.enterprisedt.net.puretls.N.A(Unknown Source)
at com.enterprisedt.net.puretls.I.A(Unknown Source)
at com.enterprisedt.net.puretls.Y.A(Unknown Source)
at com.enterprisedt.net.puretls.r.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:452)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:494)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:222)
at java.io.InputStreamReader.read(InputStreamReader.java:177)
at java.io.BufferedReader.fill(BufferedReader.java:147)
at java.io.BufferedReader.readLine(BufferedReader.java:310)
at java.io.BufferedReader.readLine(BufferedReader.java:373)
at com.enterprisedt.net.ftp.FTPControlSocket.E(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.B(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(Unknown Source)
at com.enterprisedt.net.ftp.ssl.SSLFTPControlSocket.<init>(Unknown Source)
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.connect(Unknown Source)
...........................................

I really like Edit FTP pro for it's simplicity, documentation and that it is java based. So, I started using it. But we are very close to moving this into production and I really need some help with this or I may be forced to move on to a different FTP program.

Please let me know if you need any more logging informaiton and I will send it right away?

Thanks
Sowjanya

17 Answers

0 votes
by (480 points)
I have File Zilla Server software on my machine. I use it to test file transmissions on normal FTP port i.e. 21.
Is it easy to setup a Implicit SSL FTP server on my machine to test it out? I don't know if it worth the effort.

Thanks
Sowjanya
0 votes
by (162k points)
In your very first post, the blocked port was apparently not the issue, as the transfer succeeded but the control connection timed out waiting for the server response.
0 votes
by (480 points)
Any idea what the following exception messages from my original post mean or translate into?

Caused by: com.enterprisedt.net.puretls.SSLPrematureCloseException: Short read
at com.enterprisedt.net.puretls.N.A(Unknown Source)
at com.enterprisedt.net.puretls.I.A(Unknown Source)
at com.enterprisedt.net.puretls.Y.A(Unknown Source)
at com.enterprisedt.net.puretls.r.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:452)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:494)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:222)
at java.io.InputStreamReader.read(InputStreamReader.java:177)
at java.io.BufferedReader.fill(BufferedReader.java:147)
at java.io.BufferedReader.readLine(BufferedReader.java:310)
at java.io.BufferedReader.readLine(BufferedReader.java:373)
at com.enterprisedt.net.ftp.FTPControlSocket.E(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.B(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(Unknown Source)
at com.enterprisedt.net.ftp.ssl.SSLFTPControlSocket.<init>(Unknown Source)
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.connect(Unknown Source)


Thanks
Sowjanya
0 votes
by (162k points)
Using SSLFTPClient.ConfigFlags.DISABLE_SSL_CLOSURE flag should prevent this from occurring. But it appears you also have a problem with the data port.
0 votes
by (480 points)
I cannot check with my network admin regarding the data port issue until the next 7-8 hours.

But is the following syntax any better than just SSLFTPClient.ConfigFlags.DISABLE_SSL_CLOSURE. I came across it in another posting on this site.

ftp.setConfigFlags(SSLFTPClient.ConfigFlags.DISABLE_SSL_CLOSURE | SSLFTPClient.ConfigFlags.DISABLE_WAIT_ON_CLOSE);
0 votes
by (480 points)
This is probably a silly question but I will ask it anyway.
When I try to connect with FileZilla it asks me to accept the server certitificate. What is it's equivilent step when I am connecting using edit FTP Pro API ? I certainly don't have any references to certificates in my code.

Pretty much like the following

log.info("Creating FTP client");
ftp = new SSLFTPClient();
ftp.setImplicitFTPS(true);
ftp.setRemoteHost("app01.winitucom.com");
ftp.setValidateServer(false);
ftp.setConfigFlags(SSLFTPClient.ConfigFlags.DISABLE_SSL_CLOSURE);
log.info("Setting remote host");
try {
ftp.connect();
log.info("sending auth()");
ftp.auth(SSLFTPClient.PROT_PRIVATE);
log.info("Logging in..... ");
ftp.login("sip.intercity-nl.com","XXXXXXX");
log.info("Setting connect mode..... ");
ftp.setConnectMode(FTPConnectMode.PASV);

log.info("Setting transfer type..... ");
ftp.setType(FTPTransferType.BINARY);
0 votes
by (162k points)
Full explanation of flags in API reference:

http://www.enterprisedt.com/products/ed ... Flags.html

Calling ftp.setValidateServer(false) disables certificate checking. You can enable it and check the certificate, see

http://www.enterprisedt.com/products/ed ... parta.html

Categories

...