title: How to connect to FTP over TLS/SSL (FTPS) server in Java
body: <p>I'm stuck in connecting to FTP over TLS/SSL (FTPS) server. I am using SimpleFTP library through am able to connect FTP server without SSL but could not connect FTPS.</p>
  
  <p>It is giving me this error at line 2 (ftp.connect),</p>
  
  <blockquote>
    <p>SimpleFTP received an unknown response when connecting to the FTP server:<br>
    220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------</p>
  </blockquote>
  
  <p>and am using below code</p>
  
  <pre><code>SimpleFTP ftp = new SimpleFTP();
  
  // Connect to an FTP server on port 21.
  ftp.connect("xxx.xxx.xxx.xxx", 21, "username", "pwd");
  //getting error at (ftp.connect) above line
  
  // Set binary mode.
  ftp.bin();
  
  // Change to a new working directory on the FTP server.
  ftp.cwd("web");
  ftp.disconnect();
  </code></pre>