Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.7k views
in Java FTP by (1.1k points)
Each minute I'm connecting to a FTP server via SSL.

In this case i got 4 files to transfert.
The first time => i'm transferting the first file. All is ok.
The second time => i'm transfering the second file. Transfert is ok ... but all logs are twice long ! All log line are doubled like this :

DEBUG [SSLFTPPassiveDataSocket] 19 d

5 Answers

0 votes
by (162k points)
Please post your code
0 votes
by (1.1k points)
com.enterprisedt.util.license.License.setLicenseDetails(...);
Logger.setLevel(Level.ALL);
Logger.addAppender(new FileAppender("c:\\ssldebug.log"));
(...)
while(...) // Every minute
{
                SSLFTPClient secureFtpClient = new SSLFTPClient();
   SSLFTPStandardValidator.MAX_CERTIFICATE_CHAIN_LENGTH = 4;
               
   secureFtpClient.setConfigFlags(SSLFTPClient.ConfigFlags.DISABLE_CONTROL_SSL_CLOSURE);
   
   secureFtpClient.setRemoteHost(facturable.getIpFTP());
   secureFtpClient.setRemotePort(facturable.getPortFTP());
   secureFtpClient.getRootCertificateStore().importPEMFile(facturable.getServerCertPath());         secureFtpClient.setCustomValidator(new SSLFTPStandardValidator(false));
   secureFtpClient.loadClientCertificate(facturable.getClientCertPath(), facturable.getClientCertPwd());
   secureFtpClient.connect();
   secureFtpClient.auth(SSLFTPClient.AUTH_TLS);
   secureFtpClient.login(facturable.getLoginFTP(), facturable.getMdpFTP());
                
   String[] tblStringTmp = sbCheminFichierExport.toString().split("/");
   secureFtpClient.put("myFile.txt");
                
   secureFtpClient.quit();
}
0 votes
by (162k points)
Sure you aren't calling addAppender in the loop?
0 votes
by (1.1k points)
Sure you aren't calling addAppender in the loop?


it's sure :)
0 votes
by (162k points)
I've tried to duplicate your problem without success. My test client:

public static void main(String[] args) throws Exception {
        
        // assign args to make it clear
        String host = args[0];
        String user = args[1];
        String password = args[2];
        Logger.setLevel(Level.ALL); 
        Logger.addAppender(new FileAppender("d:\\tmp\\ssldebug.log")); 
        for (int i = 0; i < 5; i++) {
            
            // set up client
            SSLFTPClient ftp = new SSLFTPClient();
            ftp.setValidateServer(false);
            ftp.setRemoteHost("localhost");
            
            
            ftp.connect();

            // switch to SSL on control channel
            ftp.auth(SSLFTPClient.AUTH_TLS);

            // login
            ftp.login(user, password);

            // switch to SSL data-channels
            ftp.pbsz(0);
            ftp.prot('P');

         // Shut down client                
            ftp.quit();

        } 
    }   

Categories

...