title: Java FTPS Problems
body: <p>Still unanswered. Any and all help is appreciated!</p>
  
  <p>I am using Apache Commons-Net3.1 and trying to get the FTPS working. When I try to connect, I am getting the following errors in the console : </p>
  
  <p>---EDIT: CODE AND ERRORS UPDATED---</p>
  
  <pre><code>java.net.ConnectException: Connection refused: connect
  at java.net.DualStackPlainSocketImpl.connect0(Native Method)
  at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at org.apache.commons.net.SocketClient.connect(SocketClient.java:171)
  at org.apache.commons.net.SocketClient.connect(SocketClient.java:192)
  at org.apache.commons.net.SocketClient.connect(SocketClient.java:285)
  </code></pre>
  
  <p>I am sure I am just not setting up it up right. Here is my code. Any point in the right direction would be greatly appreciated. (I am trying to connect via port 990 by the way). The code errors at the line "client.connect(ftpHost);"</p>
  
  <pre><code>import org.apache.commons.net.ftp.FTPSClient;
  import java.io.IOException;
  import java.io.FileOutputStream;
  
  public class MyFTP {
   public void downloadFTP(){
  
          FTPSClient client = new FTPSClient(false);
  
          FileOutputStream fos = null;
          client.setTrustManager(TrustManagerUtils.getAcceptAllTrustManager());
  
          try {
              client.connect(ftpHost);
              client.enterLocalPassiveMode();
              client.login(ftpUser, ftpPassword);
  
  
              String filename = "liveGUIfile.txt";
              fos = new FileOutputStream(filename);
  
  
              client.retrieveFile("/root/Desktop/" + filename, fos);
          } catch (IOException e) {
              e.printStackTrace();
          } finally {
              try {
                  if (fos != null) {
                      fos.close();
                  }
                  client.disconnect();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
  
      }
  }
  </code></pre>