Package org.apache.ftpserver.ssl

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


        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,
View Full Code Here

            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

                new ProtocolCodecFilter(new FtpServerProtocolCodecFactory()));
        acceptor.getFilterChain().addLast("mdcFilter2", mdcFilter);
        acceptor.getFilterChain().addLast("logger", new FtpLoggingFilter());

        if (isImplicitSsl()) {
            SslConfiguration ssl = getSslConfiguration();
            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());
            }

            acceptor.getFilterChain().addFirst("sslFilter", sslFilter);
        }
View Full Code Here

        if (StringUtils.hasText(element.getAttribute("port"))) {
            factoryBuilder.addPropertyValue("port", Integer.parseInt(element
                    .getAttribute("port")));
        }

        SslConfiguration ssl = parseSsl(element);
        if (ssl != null) {
            factoryBuilder.addPropertyValue("sslConfiguration", ssl);
        }

        Element dataConElm = SpringUtil.getChildElement(element,
View Full Code Here

            final SslConfiguration listenerSslConfiguration) {
        DataConnectionConfigurationFactory dc = new DataConnectionConfigurationFactory();

        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

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

                .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) {
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.ssl.SslConfiguration

Copyright © 2018 www.massapicom. 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.