Hi,
I am new to the product and experiencing an issue using the SSLFTPClient. I am getting an exception when using the get command. The exception I am receiving is "java.io.IOException: Bad record type34".
Here is the Java code:
// create an explicit FTPS client
SSLFTPClient ftp = new SSLFTPClient();
FTPClientInterface c;
ftp.setRemoteHost("213.86.13.59");
ftp.setRemotePort(990);
ftp.setTimeout(60000);
ftp.setImplicitFTPS(true);
ftp.debugResponses(true);
ftp.setConnectMode(FTPConnectMode.PASV);
// Turn off server validation (ONLY do this when testing)
ftp.setValidateServer(false);
// connect to the server
ftp.connect();
// switch to secure command channel
// ftp.auth(SSLFTPClient.AUTH_SSL);
// log in
ftp.login("106052", "password");
ftp.setType(FTPTransferType.BINARY);
// Change the current directory
ftp.chdir("User/106052/");
ftp.get("C:\\opt\\JavaApps\\MDS\\services\\ICMA\\", "DR106052001_20070912133841_ICMA.csv");
// close the connection
ftp.quit();
And here is the exception:
DEBUG [SSLFTPClient] 18 Sep 2007 17:10:14.774 : Turned server validation off
DEBUG [SSLFTPClient] 18 Sep 2007 17:10:15.336 : Created implicit FTPS client.
DEBUG [SSLFTPClient] 18 Sep 2007 17:10:15.336 : Connecting to /213.86.13.59:990
DEBUG [SSLSocketUtils] 18 Sep 2007 17:10:15.383 : Invoking connect with timeout=60000
INFO [cryptix] 18 Sep 2007 17:10:20.305 : GLOBAL_TRACE=false
INFO [cryptix] 18 Sep 2007 17:10:20.305 : GLOBAL_DEBUG=false
INFO [cryptix] 18 Sep 2007 17:10:20.305 : GLOBAL_DEBUG_SLOW=false
DEBUG [IJCE_Properties] 18 Sep 2007 17:10:24.977 : Successfully loaded the IJCE properties file
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:27.336 : 220-Glub Tech Secure FTP Wrapper (v2.5.9.1)
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:27.352 : 220 issdmzftp01a Microsoft FTP Service (Version 5.0).
DEBUG [SSLFTPControlSocket] 18 Sep 2007 17:10:27.352 : DISABLE_CONTROL_SSL_CLOSURE=false
DEBUG [SSLFTPControlSocket] 18 Sep 2007 17:10:27.352 : DISABLE_CONTROL_WAIT_ON_CLOSE=false
DEBUG [SSLFTPControlSocket] 18 Sep 2007 17:10:27.352 : ALLOW_BASIC_CONSTRAINTS_IN_NON_CA=false
DEBUG [SSLFTPControlSocket] 18 Sep 2007 17:10:27.352 : SSL handshake completed on control channel
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:28.680 : ---> USER 106052
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:28.680 : 331 Password required for 106052.
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:28.680 : ---> PASS ********
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:28.711 : 230 User 106052 logged in.
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:29.758 : ---> TYPE I
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:29.774 : 200 Type set to I.
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:32.118 : ---> CWD User/106052/
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:32.133 : 250 CWD command successful.
DEBUG [FTPClient] 18 Sep 2007 17:10:35.586 : Setting local path to C:\opt\JavaApps\MDS\services\ICMA\\DR106052001_20070912133841_ICMA.csv
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:35.586 : ---> PASV
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:35.602 : 227 Entering Passive Mode (213,86,13,59,11,207).
DEBUG [SSLFTPControlSocket] 18 Sep 2007 17:10:35.602 : Creating SSLFTPPassiveDataSocket
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:40.118 : ---> RETR DR106052001_20070912133841_ICMA.csv
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:40.180 : 125 Data connection already open; Transfer starting.
DEBUG [SSLFTPPassiveDataSocket] 18 Sep 2007 17:10:40.180 : Starting SSL handshake on passive data socket
ERROR [FTPClient] 18 Sep 2007 17:10:40.180 : Caught and rethrowing exception in getDataAfterInitGet() : java.io.IOException: Bad record type34
com.enterprisedt.net.puretls.SSLHandshakeFailedException: java.io.IOException: Bad record type34
at com.enterprisedt.net.puretls.i.G(Unknown Source)
at com.enterprisedt.net.puretls.SSLSocket.handshake(Unknown Source)
at com.enterprisedt.net.ftp.ssl.C.A(Unknown Source)
at com.enterprisedt.net.ftp.ssl.C.getInputStream(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.get(Unknown Source)
at com.man.test.SftpAdapter.SSLFTP(SftpAdapter.java:79)
at com.man.test.SftpAdapter.main(SftpAdapter.java:34)
DEBUG [SSLFTPPassiveDataSocket] 18 Sep 2007 17:10:40.180 : Sending SSL closure alert on passive data socket
DEBUG [SSLFTPPassiveDataSocket] 18 Sep 2007 17:10:40.180 : Waiting for SSL closure response on passive data socket
DEBUG [SSLFTPPassiveDataSocket] 18 Sep 2007 17:10:40.180 : Closing passive data socket
DEBUG [FTPClient] 18 Sep 2007 17:10:40.180 : Deleting local file 'C:\opt\JavaApps\MDS\services\ICMA\DR106052001_20070912133841_ICMA.csv'
DEBUG [FTPClient] 18 Sep 2007 17:10:40.180 : Validate transfer on error after exception : java.io.IOException: Bad record type34
com.enterprisedt.net.puretls.SSLHandshakeFailedException: java.io.IOException: Bad record type34
at com.enterprisedt.net.puretls.i.G(Unknown Source)
at com.enterprisedt.net.puretls.SSLSocket.handshake(Unknown Source)
at com.enterprisedt.net.ftp.ssl.C.A(Unknown Source)
at com.enterprisedt.net.ftp.ssl.C.getInputStream(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.get(Unknown Source)
at com.man.test.SftpAdapter.SSLFTP(SftpAdapter.java:79)
at com.man.test.SftpAdapter.main(SftpAdapter.java:34)
DEBUG [FTPControlSocket] 18 Sep 2007 17:10:40.336 : 226 Transfer complete.
com.enterprisedt.net.puretls.SSLHandshakeFailedException: java.io.IOException: Bad record type34
at com.enterprisedt.net.puretls.i.G(Unknown Source)
at com.enterprisedt.net.puretls.SSLSocket.handshake(Unknown Source)
at com.enterprisedt.net.ftp.ssl.C.A(Unknown Source)
at com.enterprisedt.net.ftp.ssl.C.getInputStream(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.get(Unknown Source)
at com.man.test.SftpAdapter.SSLFTP(SftpAdapter.java:79)
at com.man.test.SftpAdapter.main(SftpAdapter.java:34)
Any help would be greatly appreciated.
Thanks,
Jamie
________
Umw motor (malaysia)