SSLContext context = SSLContext.getInstance("TLS");
// these are the same key and trust managers that we initialize the client with
context.init(new KeyManager[] { clientKeyManager },
new TrustManager[] { clientTrustManager }, null);
sclient.setSocketFactory(new FTPSSocketFactory(context));
SSLServerSocketFactory ssf = context.getServerSocketFactory();
sclient.setServerSocketFactory(ssf);
// FTPClient should not use SSL secured sockets for the data connection
}