session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_502_COMMAND_NOT_IMPLEMENTED, "AUTH", null));
}
}
private void secureSession(final FtpIoSession session, final String type) throws GeneralSecurityException, FtpException {
SslConfiguration ssl = session.getListener().getSslConfiguration();
if(ssl != null) {
session.setAttribute(SslFilter.DISABLE_ENCRYPTION_ONCE);
SslFilter sslFilter = new SslFilter( ssl.getSSLContext() );
if(ssl.getClientAuth() == ClientAuth.NEED) {
sslFilter.setNeedClientAuth(true);
} else if(ssl.getClientAuth() == ClientAuth.WANT) {
sslFilter.setWantClientAuth(true);
}
if(ssl.getEnabledCipherSuites() != null) {
sslFilter.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
}
session.getFilterChain().addFirst("sslSessionFilter", sslFilter);
} else {
throw new FtpException("Socket factory SSL not configured");