title: FTPSClient retrievefile() hanging
body: <p>I'm creating an apache FTPS client (because the remote server won't allow plain FTP). I can connect and delete files without problem, but when using retrieveFile() or retrieveFileStream(), it hangs.</p>
  
  <p>For some reason, very small files do transfer (up to 5792 bytes), but anything else gives the following PrintCommandListener output:</p>
  
  <blockquote>
    <p>run:<br>
    220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------<br>
    220-You are user number 2 of 50 allowed.<br>
    220-Local time is now 19:42. Server port: 21.<br>
    220-This is a private system - No anonymous login<br>
    220-IPv6 connections are also welcome on this server.<br>
    220 You will be disconnected after 15 minutes of inactivity.<br>
    AUTH TLS<br>
    234 AUTH TLS OK.<br>
    USER <br>
    331 User  OK. Password required<br>
    PASS <br>
    230 OK. Current restricted directory is /<br>
    TYPE A<br>
    200 TYPE is now ASCII<br>
    EPSV<br>
    229 Extended Passive mode OK (|||53360|)<br>
    RETR test.txt<br>
    150-Accepted data connection<br>
    150 7.3 kbytes to download</p>
  </blockquote>
  
  <p>Here is the code:</p>
  
  <pre><code>try {
  
      FTPSClient ftpClient = new FTPSClient("tls",false);
  
      ftpClient.addProtocolCommandListener(new PrintCommandListener(new  PrintWriter(System.out)));
  
      ftpClient.connect(host, port);
  
      int reply = ftpClient.getReplyCode();
  
      if (FTPReply.isPositiveCompletion(reply)) {
          ftpClient.enterLocalPassiveMode();
          ftpClient.login(username, password);
          ftpClient.enterLocalPassiveMode();
          FileOutputStream outputStream = new FileOutputStream(tempfile);
          ftpClient.setFileType(FTPClient.ASCII_FILE_TYPE);
          ftpClient.retrieveFile("test.txt", outputStream);
          outputStream.close();
          ftpClient.logout();
          ftpClient.disconnect();
      }
  } catch (IOException ioe) {
      System.out.println("FTP client received network error");
  }
  </code></pre>
  
  <p>Any ideas are greatly appreciated.</p>