I got this method do connect to a local or remote FTP server. When I start this method in Eclipse (IDE), it works fine. But when I try to run it in EBUS-J (it's a Java source code generator with a programming language like BASIC) it wont go pass the connect method. Here is the method:
public String doConnect() {
try {
System.out.println("before connection");
this.ftps.connect(this.server);
System.out.println("before SetBufferSize");
this.ftps.setBufferSize(1000);
System.out.println("before Login");
if (!this.ftps.login(this.username, this.password)) {
this.ftps.logout();
System.out.println("logged out");
}
System.out.println("before positiveCompletion");
if (!FTPReply.isPositiveCompletion(this.ftps.getReplyCode())) {
this.ftps.disconnect();
System.out.println("disconnected");
return returnTrue("false");
} else {
return returnTrue("true");
}
} catch (Exception e) {
return returnFalse("Couldnt connect to server");
}
}
And here is what my local server says, if it successful out of eclipse. When I start my generated Program by my Interpreter, it stops at "AUTL TLS", see at bottom:
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.41 beta
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> AUTH TLS
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> SSL connection established
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> USER root
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 331 Password required for root
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> PASS
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 230 Logged on
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> TYPE I
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 200 Type set to I
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> PASV
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,219,159)
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> STOR Beispieldatei.txt
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 150 Connection accepted
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> disconnected.
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.41 beta
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> AUTH TLS
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000030)10.05.2017 16:52:20 - (not logged in) (127.0.0.1)> 421 Login time exceeded. Closing control connection.
Here is the log file with the newest FileZilla version:
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> Connected on port 21, sending welcome message...
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 220-FileZilla Server 0.9.60 beta
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 220 Please visit https://filezilla-project.org/
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> AUTH TLS
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000003)29.05.2017 14:39:19 - (not logged in) (127.0.0.1)> 421 Login time exceeded. Closing control connection.
(000003)29.05.2017 14:39:19 - (not logged in) (127.0.0.1)> disconnected.
As I mentioned, running it in eclipse works fine, but with EBUS-J, it wont pass the SSL/TLS handshake I guess.
- I don't get an exception or error message.
- I can wait more than a minute before the server closes the connection, so I cancelled it directly. -> 1 second.
Any ideas? Thanks, Louis