title: Can not connect to FTP server from heroku using apache client for Java. 503 error Login incorrect
body: <p>I'm writing an app that will be uploading files to FTP server. To connect with FTP server I'm using FTPClient from org.apache.commons.net.ftp. When I run my code locally everything is ok, but problem occurs when trying to login to ftp from Heroku dyno. There are no any errors in server logs, only get and post informations. Following log is displayed by FTPClient:</p>
  
  <blockquote>
    <p>app[web.1]: 220 FTP server ready<br/>
    app[web.1]: PASS XXX<br/>
    app[web.1]: USER XXX<br/>
    app[web.1]: 331 Password required for XXX<br/>
    app[web.1]: 530 Login incorrect.<br/>
    app[web.1]: TYPE I<br/>
    app[web.1]: 221 Goodbye.<br/>
    app[web.1]: QUIT<br/>
    app[web.1]: 530 Please login with USER and PASS<br/>
    app[web.1]: 200 Type set to I<br/>
    app[web.1]: PORT 172,17,212,146,145,63<br/></p>
  </blockquote>
  
  <p>Password and login are ok because it works locally. I thought that it may be encoding on heroku but i changed it to utf-8 but error is still that same. I'm using following code to connect with FTP</p>
  
  <pre><code>private FTPClient ftp;
  
  public void connect(String host, String username, String password) throws IOException {
      ftp = new FTPClient();
      ftp.enterLocalPassiveMode();
      ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
      ftp.connect(host);
      ftp.login(username,password);
      ftp.setFileType(FTP.BINARY_FILE_TYPE);
  }
  </code></pre>
  
  <p>Application is deployed on jetty server.</p>
  
  <p>EDIT<br/>
  I don't mentioned it before, I'm login to that same FTP server in both cases (local and on heroku).
  Password and login are send in correct order. I tried also to do it manually it means that i called methods <em>username</em> and <em>password</em> instead of <em>login</em> so i'm sure that orded is correct</p>