Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
15.1k views
in Java FTP by (420 points)
hello experts,

i am trying out the edtftp/ssl package and experiencing some problems...

first, here is a logextract from a connection with smartftp (client):
(changed name and ip's for private reasons)

Resolving host name ftp1.XXXXX.com...
Connecting to (ftp1.XXXXX.com) -> IP: 1.1.1.1 PORT: 21
Connected to (ftp1.XXXXX.com) -> Time = 31ms
Socket connected waiting for login sequence.
220 ftp1.XXXX.com X2 WS_FTP Server 4.0.0 (2024413583)
AUTH SSL
234 SSL enabled and waiting for negotiation
Connected. Exchanging encryption keys...
Session Cipher: 128 bit RC4
SSL encrypted session established.
PBSZ 0
200 PBSZ=0
USER test
331 Password required
PASS (hidden)
230 user logged in
SYST
215 UNIX
FEAT
211-Extensions supported
SIZE
MDTM
MLST size*;type*;perm*;create*;modify*;
LANG EN*
REST STREAM
TVFS
UTF8
AUTH SSL;TLS-P;
PBSZ
PROT C;P;
211 end
Detected Server Software: WS_FTP Server 3.x
SITE UTF8
200 UTF8 encoding forced.
PWD
257 "/demo" is current directory
TYPE A
200 Type set to ASCII.
PROT P
200 PRIVATE data channel protection level set
PORT 214,24,123,9,8,176
200 command successful
Opening data connection IP: 214.24.123.9 PORT: 2224.
MLSD
150 Opening ASCII data connection for directory listing
Connected. Exchanging encryption keys...
Session Cipher: 128 bit RC4
SSL encrypted session established.
883 bytes received successfully. (883 B/s) (00:00:01).
226 transfer complete


and now the debug-output of my java-attempt..:

INFO [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 9 Nov 2004 16:46:32.905 : Licence expiry date: 01 Dez 2004
INFO [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 9 Nov 2004 16:46:32.905 : Trial licence
DEBUG [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 9 Nov 2004 16:46:33.93 : Created explicit FTPS client.
DEBUG [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 9 Nov 2004 16:46:33.93 : Turned server validation off
DEBUG [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 9 Nov 2004 16:46:33.93 : Connecting to ftp1.XXXXX.com/1.1.1.1:21
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:33.218 : 220 ftp1.XXXXX.com X2 WS_FTP Server 4.0.0 (2025040286)
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:33.218 : ---> AUTH SSL
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:33.749 : 234 SSL enabled and waiting for negotiation
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:33.749 : Starting SSL handshake on control socket
INFO [puretls] 9 Nov 2004 16:46:33.937 : PureTLS debug level=0
INFO [cryptix] 9 Nov 2004 16:46:34.77 : GLOBAL_TRACE=false
INFO [cryptix] 9 Nov 2004 16:46:34.77 : GLOBAL_DEBUG=false
INFO [cryptix] 9 Nov 2004 16:46:34.77 : GLOBAL_DEBUG_SLOW=false
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.280 : SSL handshake on control socket complete
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.280 : ---> PBSZ 0
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.312 : 200 PBSZ=0
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.312 : ---> PROT P
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.343 : 200 PRIVATE data channel protection level set
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.343 : ---> USER test
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.390 : 331 Password required
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.390 : ---> PASS ********
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.437 : 230 user logged in
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.437 : ---> PROT P
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.468 : 200 PRIVATE data channel protection level set
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.483 : Creating SSLFTPActiveDataSocket
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.483 : ---> PORT 192,168,100,90,13,176
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 9 Nov 2004 16:46:34.530 : 504 Invalid PORT address
exc.:Invalid PORT address
com.enterprisedt.net.ftp.FTPException: Invalid PORT address
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.dir(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.dir(Unknown Source)
at com.adm.aegon.test.FTPTest.main(FTPTest.java:43)




and finally my source:

public static void main(String[] args) {
String Server = "ftp1.XXXXX.com";

Logger.setLevel(Level.ALL);

try {
SSLFTPClient ftp =
new SSLFTPClient(Server,0);
ftp.setValidateServer(false);
ftp.setConnectMode(FTPConnectMode.ACTIVE);
ftp.connect();
ftp.auth(SSLFTPClient.AUTH_SSL);
ftp.user("test");
ftp.password("*****");

ftp.prot(SSLFTPClient.PROT_PRIVATE);


System.out.println("Directory:"+
ftp.dir()
); // get directory listing, just a debug output...


ftp.quit();
System.out.println("finish!");
}
catch (Exception e) {
System.out.println("exc.:"+e.getMessage());
e.printStackTrace(System.out);
}
}


the problem is, that the connecting client is behind a firewall and the server accepts only connections from one specific ip (214.24.123.9).
as you can see, if i connect via smartftp, the port command issued sets this ip, while connecting via my java-tries the port command sets my
local ip.... how do i fix this?

thanx,
yves

11 Answers

0 votes
by (420 points)
ok, i will do so..

concerning your question about the server...
if i am reading the logfiles correct, i think it is

WS_FTP Server 4.0.0 (2088763724)

yves

Categories

...