missing variable
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java b/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
index 58ab386..b34837b 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
@@ -114,40 +114,38 @@
}
}
- private void secureSession(final FtpIoSession session, final String type)
- throws GeneralSecurityException, FtpException {
- SslConfiguration ssl = session.getListener().getSslConfiguration();
+ 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);
+ 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);
- }
+ SslFilter sslFilter = new SslFilter(ssl.getSSLContext());
+ if (ssl.getClientAuth() == ClientAuth.NEED) {
+ sslFilter.setNeedClientAuth(true);
+ } else if (ssl.getClientAuth() == ClientAuth.WANT) {
+ sslFilter.setWantClientAuth(true);
+ }
- // note that we do not care about the protocol, we allow both types
- // and leave it to the SSL handshake to determine the protocol to
- // use. Thus the type argument is ignored.
+ // note that we do not care about the protocol, we allow both types
+ // and leave it to the SSL handshake to determine the protocol to
+ // use. Thus the type argument is ignored.
- if (ssl.getEnabledCipherSuites() != null) {
- sslFilter.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
- }
-
- if(ssl.getEnabledProtocol() != null ) {
- sslFilter.setEnabledProtocols(new String[] {ssl.getEnabledProtocol()});
- }
+ if (ssl.getEnabledCipherSuites() != null) {
+ sslFilter.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
+ }
- session.getFilterChain().addFirst(SSL_SESSION_FILTER_NAME,
- sslFilter);
+ if (ssl.getEnabledProtocol() != null) {
+ sslFilter.setEnabledProtocols(new String[] { ssl.getEnabledProtocol() });
+ }
- if("SSL".equals(type)) {
- session.getDataConnection().setSecure(true);
- }
- } else {
- throw new FtpException("Socket factory SSL not configured");
- }
+ session.getFilterChain().addFirst(SSL_SESSION_FILTER_NAME, sslFilter);
+
+ if ("SSL".equals(type)) {
+ session.getDataConnection().setSecure(true);
+ }
+ } else {
+ throw new FtpException("Socket factory SSL not configured");
+ }
}
}
diff --git a/core/src/main/java/org/apache/ftpserver/ssl/impl/DefaultSslConfiguration.java b/core/src/main/java/org/apache/ftpserver/ssl/impl/DefaultSslConfiguration.java
index b7f71e5..15866bc 100644
--- a/core/src/main/java/org/apache/ftpserver/ssl/impl/DefaultSslConfiguration.java
+++ b/core/src/main/java/org/apache/ftpserver/ssl/impl/DefaultSslConfiguration.java
@@ -134,7 +134,7 @@
}
// create and initialize the SSLContext
- SSLContext ctx = SSLContext.getInstance(sslProtocol);
+ SSLContext ctx = SSLContext.getInstance(enabledProtocol);
ctx.init(keyManagers, trustManagerFactory.getTrustManagers(), null);
// Create the socket factory
return ctx;