Examples of SslConfiguration


Examples of org.apache.ftpserver.ssl.SslConfiguration

        if (element != null) {
           
            dc.setImplicitSsl(SpringUtil.parseBoolean(element, "implicit-ssl", false));
           
            // data con config element available
            SslConfiguration ssl = parseSsl(element);

            if (ssl != null) {
                LOG.debug("SSL configuration found for the data connection");
                dc.setSslConfiguration(ssl);
            }
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

public class PROT extends AbstractCommand {

    private SslConfiguration getSslConfiguration(final FtpIoSession session) {
        DataConnectionConfiguration dataCfg = session.getListener().getDataConnectionConfiguration();
       
        SslConfiguration configuration = dataCfg.getSslConfiguration();

        // fall back if no configuration has been provided on the data connection config
        if(configuration == null) {
            configuration = session.getListener().getSslConfiguration();
        }
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

        }
    }

    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);
            }

            // 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());
            }

            session.getFilterChain().addFirst(SSL_SESSION_FILTER_NAME,
                    sslFilter);
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

                    new ProtocolCodecFilter(new FtpServerProtocolCodecFactory()));
            acceptor.getFilterChain().addLast("mdcFilter2", mdcFilter);
            acceptor.getFilterChain().addLast("logger", new FtpLoggingFilter());
   
            if (isImplicitSsl()) {
                SslConfiguration ssl = getSslConfiguration();
                SslFilter sslFilter;
                try {
                    sslFilter = new SslFilter(ssl.getSSLContext());
                } catch (GeneralSecurityException e) {
                    throw new FtpServerConfigurationException("SSL could not be initialized, check configuration");
                }
   
                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());
                }
   
                acceptor.getFilterChain().addFirst("sslFilter", sslFilter);
            }
   
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

                    new ProtocolCodecFilter(new FtpServerProtocolCodecFactory()));
            acceptor.getFilterChain().addLast("mdcFilter2", mdcFilter);
            acceptor.getFilterChain().addLast("logger", new FtpLoggingFilter());
   
            if (isImplicitSsl()) {
                SslConfiguration ssl = getSslConfiguration();
                SslFilter sslFilter;
                try {
                    sslFilter = new SslFilter(ssl.getSSLContext());
                } catch (GeneralSecurityException e) {
                    throw new FtpServerConfigurationException("SSL could not be initialized, check configuration");
                }
   
                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());
                }
   
                acceptor.getFilterChain().addFirst("sslFilter", sslFilter);
            }
   
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

            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");
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

    protected void doParse(final Element element, final ParserContext parserContext, final BeanDefinitionBuilder builder) {
        if(StringUtils.hasText(element.getAttribute("port"))) {
            builder.addPropertyValue("port", Integer.parseInt(element.getAttribute("port")));
        }
       
        SslConfiguration ssl = parseSsl(element);
        if(ssl != null) {
            builder.addPropertyValue("sslConfiguration", ssl);
        }
       
        Element dataConElm = SpringUtil.getChildElement(element, FtpServerNamespaceHandler.FTPSERVER_NS, "data-connection");
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

    private DataConnectionConfiguration parseDataConnection(final Element element, final SslConfiguration listenerSslConfiguration) {
        DefaultDataConnectionConfiguration dc = new DefaultDataConnectionConfiguration();
       
        if(element != null) {
            // data con config element available
            SslConfiguration ssl = parseSsl(element);
            if(ssl != null) {
                LOG.debug("SSL configuration found for the data connection");
                dc.setSslConfiguration(ssl);
            } else {
                // go look for the parent element SSL config
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

                address = serverControlAddress;
            }

            if(secure) {
                LOG.debug("Opening SSL passive data connection on address \"{}\" and port {}", address, passivePort);
                SslConfiguration ssl = dataCfg.getSslConfiguration();
                if(ssl == null) {
                    throw new DataConnectionException("Data connection SSL required but not configured.");
                }
                servSoc = createServerSocket(ssl, address, passivePort);
                port = servSoc.getLocalPort();
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

        DataConnectionConfiguration dataConfig = session.getListener().getDataConnectionConfiguration();
        try {
            if(!passive) {
                int localPort = dataConfig.getActiveLocalPort();
                if(secure) {
                    SslConfiguration ssl = dataConfig.getSslConfiguration();
                    if(ssl == null) {
                        throw new FtpException("Data connection SSL not configured");
                    }
                    if(localPort == 0) {
                        dataSoc = createSocket(ssl, address, port, null, localPort, false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.