Package org.apache.qpid.ssl

Examples of org.apache.qpid.ssl.SSLContextFactory



            String keystorePath = serverConfig.getKeystorePath();
            String keystorePassword = serverConfig.getKeystorePassword();
            String certType = serverConfig.getCertType();
            SSLContextFactory sslFactory = null;

            if (!serverConfig.getSSLOnly())
            {

                for(int port : ports)
                {

                    NetworkDriver driver = new MINANetworkDriver();

                    Set<VERSION> supported = EnumSet.allOf(VERSION.class);

                    if(exclude_0_10.contains(port))
                    {
                        supported.remove(VERSION.v0_10);
                    }

                    if(exclude_0_9_1.contains(port))
                    {
                        supported.remove(VERSION.v0_9_1);
                    }
                    if(exclude_0_9.contains(port))
                    {
                        supported.remove(VERSION.v0_9);
                    }
                    if(exclude_0_8.contains(port))
                    {
                        supported.remove(VERSION.v0_8);
                    }

                    MultiVersionProtocolEngineFactory protocolEngineFactory =
                            new MultiVersionProtocolEngineFactory(hostName, supported);



                    driver.bind(port, new InetAddress[]{bindAddress}, protocolEngineFactory,
                                serverConfig.getNetworkConfiguration(), null);
                    ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, port),
                                                                  new QpidAcceptor(driver,"TCP"));
                    CurrentActor.get().message(BrokerMessages.LISTENING("TCP", port));

                }

            }

            if (serverConfig.getEnableSSL())
            {
                sslFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
                NetworkDriver driver = new MINANetworkDriver();

                String sslPort = commandLine.getOptionValue("s");
                int port = 0;
                if (null != sslPort)
View Full Code Here


        return id.toString();
    }
   
    public static SSLContext createSSLContext(ConnectionSettings settings) throws Exception
    {
        SSLContextFactory sslContextFactory;
       
        if (settings.getCertAlias() == null)
        {
            sslContextFactory =
                new SSLContextFactory(settings.getTrustStorePath(),
                                      settings.getTrustStorePassword(),
                                      settings.getTrustStoreCertType(),
                                      settings.getKeyStorePath(),
                                      settings.getKeyStorePassword(),
                                      settings.getKeyStoreCertType());

        } else
        {
            sslContextFactory =
                new SSLContextFactory(settings.getTrustStorePath(),
                                      settings.getTrustStorePassword(),
                                      settings.getTrustStoreCertType(),
                    new QpidClientX509KeyManager(settings.getCertAlias(),
                                                     settings.getKeyStorePath(),
                                                     settings.getKeyStorePassword(),
                                                     settings.getKeyStoreCertType()));
           
            log.debug("Using custom key manager");
        }

        return sslContextFactory.buildServerContext();
       
    }
View Full Code Here

               
        String keyStorePath = System.getProperty("javax.net.ssl.keyStore",trustStorePath);
        String keyStorePassword = System.getProperty("javax.net.ssl.keyStorePassword",trustStorePassword);
        String keyStoreCertType = System.getProperty("qpid.ssl.keyStoreCertType","SunX509");
       
        SSLContextFactory sslContextFactory = new SSLContextFactory(trustStorePath,trustStorePassword,
                                                                    trustStoreCertType,keyStorePath,
                                                                    keyStorePassword,keyStoreCertType);
       
        return sslContextFactory.buildServerContext();
       
    }
View Full Code Here


            String keystorePath = serverConfig.getKeystorePath();
            String keystorePassword = serverConfig.getKeystorePassword();
            String certType = serverConfig.getCertType();
            SSLContextFactory sslFactory = null;

            if (!serverConfig.getSSLOnly())
            {

                for(int port : ports)
                {

                    NetworkDriver driver = new MINANetworkDriver();

                    Set<VERSION> supported = EnumSet.allOf(VERSION.class);

                    if(exclude_0_10.contains(port))
                    {
                        supported.remove(VERSION.v0_10);
                    }

                    if(exclude_0_9_1.contains(port))
                    {
                        supported.remove(VERSION.v0_9_1);
                    }
                    if(exclude_0_9.contains(port))
                    {
                        supported.remove(VERSION.v0_9);
                    }
                    if(exclude_0_8.contains(port))
                    {
                        supported.remove(VERSION.v0_8);
                    }

                    MultiVersionProtocolEngineFactory protocolEngineFactory =
                            new MultiVersionProtocolEngineFactory(hostName, supported);



                    driver.bind(port, new InetAddress[]{bindAddress}, protocolEngineFactory,
                                serverConfig.getNetworkConfiguration(), null);
                    ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, port),
                                                                  new QpidAcceptor(driver,"TCP"));
                    //CurrentActor.get().message(BrokerMessages.LISTENING("TCP", port));
                    _logger.info("Qpid broker TCP port : " + port);
                }

            }

            if (serverConfig.getEnableSSL())
            {
                sslFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
                NetworkDriver driver = new MINANetworkDriver();

                //int port = serverConfig.getSSLPort();
                String sslPort = commandLine.getOptionValue("s");
                int port = 0;
View Full Code Here

        final ServerConfiguration config = _applicationRegistry.getConfiguration();
       
        String keystorePath = config.getKeystorePath();
        String keystorePassword = config.getKeystorePassword();
        String certType = config.getCertType();
        SSLContextFactory sslContextFactory = null;
        boolean isSsl = false;
        if (config.getEnableSSL() && isSSLClient(config, protocolSession))
        {
            sslContextFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
            isSsl = true;
        }
        if (config.getEnableExecutorPool())
        {
            if (isSsl)
            {
                protocolSession.getFilterChain().addAfter("AsynchronousReadFilter", "sslFilter",
                                                          new SSLFilter(sslContextFactory.buildServerContext()));
            }
            protocolSession.getFilterChain().addBefore("AsynchronousWriteFilter", "protocolFilter", pcf);
        }
        else
        {
            protocolSession.getFilterChain().addLast("protocolFilter", pcf);
            if (isSsl)
            {
                protocolSession.getFilterChain().addBefore("protocolFilter", "sslFilter",
                                                           new SSLFilter(sslContextFactory.buildServerContext()));
            }
        }

        if (ApplicationRegistry.getInstance().getConfiguration().getProtectIOEnabled())
        {
View Full Code Here

        }
        // we only add the SSL filter where we have an SSL connection
        if (_connection.getSSLConfiguration() != null)
        {
            SSLConfiguration sslConfig = _connection.getSSLConfiguration();
            SSLContextFactory sslFactory =
                    new SSLContextFactory(sslConfig.getKeystorePath(), sslConfig.getKeystorePassword(), sslConfig.getCertType());
            SSLFilter sslFilter = new SSLFilter(sslFactory.buildClientContext());
            sslFilter.setUseClientMode(true);
            session.getFilterChain().addBefore("protocolFilter", "ssl", sslFilter);
        }

        try
View Full Code Here

        }
        // we only add the SSL filter where we have an SSL connection
        if (_connection.getSSLConfiguration() != null)
        {
            SSLConfiguration sslConfig = _connection.getSSLConfiguration();
            SSLContextFactory sslFactory =
                new SSLContextFactory(sslConfig.getKeystorePath(), sslConfig.getKeystorePassword(), sslConfig.getCertType());
            SSLFilter sslFilter = new SSLFilter(sslFactory.buildClientContext());
            sslFilter.setUseClientMode(true);
            session.getFilterChain().addBefore("protocolFilter", "ssl", sslFilter);
        }

        try
View Full Code Here

            if (connectorConfig.enableSSL && isSSLClient(connectorConfig, protocolSession))
            {
                String keystorePath = connectorConfig.keystorePath;
                String keystorePassword = connectorConfig.keystorePassword;
                String certType = connectorConfig.certType;
                SSLContextFactory sslContextFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
                protocolSession.getFilterChain().addAfter("AsynchronousReadFilter", "sslFilter",
                                                          new SSLFilter(sslContextFactory.buildServerContext()));
            }
            protocolSession.getFilterChain().addBefore("AsynchronousWriteFilter", "protocolFilter", pcf);
        }
        else
        {
            protocolSession.getFilterChain().addLast("protocolFilter", pcf);
            if (connectorConfig.enableSSL && isSSLClient(connectorConfig, protocolSession))
            {
                String keystorePath = connectorConfig.keystorePath;
                String keystorePassword = connectorConfig.keystorePassword;
                String certType = connectorConfig.certType;
                SSLContextFactory sslContextFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
                protocolSession.getFilterChain().addBefore("protocolFilter", "sslFilter",
                                                           new SSLFilter(sslContextFactory.buildServerContext()));
            }

        }
    }
View Full Code Here

        }
        // we only add the SSL filter where we have an SSL connection
        if (_connection.getSSLConfiguration() != null)
        {
            SSLConfiguration sslConfig = _connection.getSSLConfiguration();
            SSLContextFactory sslFactory =
                    new SSLContextFactory(sslConfig.getKeystorePath(), sslConfig.getKeystorePassword(), sslConfig.getCertType());
            SSLFilter sslFilter = new SSLFilter(sslFactory.buildClientContext());
            sslFilter.setUseClientMode(true);
            session.getFilterChain().addBefore("protocolFilter", "ssl", sslFilter);
        }

        try
View Full Code Here

               
        String keyStorePath = System.getProperty("javax.net.ssl.keyStore",trustStorePath);
        String keyStorePassword = System.getProperty("javax.net.ssl.keyStorePassword",trustStorePassword);
        String keyStoreCertType = System.getProperty("qpid.ssl.keyStoreCertType","SunX509");
       
        SSLContextFactory sslContextFactory = new SSLContextFactory(trustStorePath,trustStorePassword,
                                                                    trustStoreCertType,keyStorePath,
                                                                    keyStorePassword,keyStoreCertType);
       
        return sslContextFactory.buildServerContext();
       
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.ssl.SSLContextFactory

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.