protected FtpServer createServer() throws Exception {
assertTrue(FTPSERVER_KEYSTORE.exists());
FtpServer server = super.createServer();
DefaultFtpServerContext context = (DefaultFtpServerContext) server.getServerContext();
NioListener listener = (NioListener) context.getListener("default");
listener.setImplicitSsl(useImplicit());
DefaultSslConfiguration sslConfig = new DefaultSslConfiguration();
sslConfig.setKeystoreFile(FTPSERVER_KEYSTORE);
sslConfig.setKeystorePassword(KEYSTORE_PASSWORD);
sslConfig.setSslProtocol(getAuthValue());
sslConfig.setClientAuthentication(getClientAuth());
sslConfig.setKeyPassword(KEYSTORE_PASSWORD);
listener.setSslConfiguration(sslConfig);
DefaultSslConfiguration dataSslConfig = new DefaultSslConfiguration();
dataSslConfig.setKeystoreFile(FTPSERVER_KEYSTORE);
dataSslConfig.setKeystorePassword(KEYSTORE_PASSWORD);
dataSslConfig.setSslProtocol(getAuthValue());
dataSslConfig.setClientAuthentication(getClientAuth());
dataSslConfig.setKeyPassword(KEYSTORE_PASSWORD);
DefaultDataConnectionConfiguration dataConfig = new DefaultDataConnectionConfiguration();
dataConfig.setSslConfiguration(dataSslConfig);
listener.setDataConnectionConfiguration(dataConfig);
return server;
}