title: ftp4j: client.login returns Unrecognized SSL message, plaintext connection?
body: <p>This is my code</p>
  
  <pre><code>try{
      TrustManager[] trustManager = new TrustManager[] { new X509TrustManager() {
          public X509Certificate[] getAcceptedIssuers() { return null; }
          public void checkClientTrusted(X509Certificate[] certs, String authType) {}
          public void checkServerTrusted(X509Certificate[] certs, String authType) {}
      } };
  
      SSLContext sslContext = null;
  
      sslContext = SSLContext.getInstance("TLS");
      sslContext.init(null, trustManager, new SecureRandom());
      SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
      FTPClient client = new FTPClient();
  
      client.setSSLSocketFactory(sslSocketFactory);
      client.setSecurity(FTPClient.SECURITY_FTPES);
  
      client.connect("xxx.xxx.xxx", 21);
      System.out.println("Connected (" + client.isConnected() + ") to host " + client.getHost() + ":" + client.getPort());
      client.login("xxxxx", "xxxxx");            
  }catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>which when is run returns</p>
  
  <pre><code>Connected (true) to host xxx.xxx.xxx:21
  </code></pre>
  
  <p>and then breaks on client.login("xxxxx", "xxxxx"); with Exception</p>
  
  <pre><code>javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
  </code></pre>
  
  <p>Any idea why this happens?</p>
  
  <p>java version is 1.4.2, ftp4j version is 1.7.2</p>