Package org.apache.activemq.transport.tcp

Examples of org.apache.activemq.transport.tcp.SslTransportFactory


    protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException {

        if (brokerURI.getScheme().equals("ssl")) {
            // If given an SSL URI, use an SSL TransportFactory and configure
            // it to use the given key and trust managers.
            SslTransportFactory transportFactory = new SslTransportFactory();
            transportFactory.setKeyAndTrustManagers(km, tm, random);

            return transportFactory.doBind(getBrokerName(), brokerURI);
        } else {
            // Else, business as usual.
            return TransportFactory.bind(getBrokerName(), brokerURI);
        }
    }
View Full Code Here


        if (!brokerURL.getScheme().equals("ssl")) {
            return super.createTransport();
        }

        try {
            SslTransportFactory sslFactory = new SslTransportFactory();
            sslFactory.setKeyAndTrustManagers(keyManager, trustManager, secureRandom);
            return sslFactory.doConnect(brokerURL);
        } catch (Exception e) {
            throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e);
        }
    }
View Full Code Here

            if (keyManager == null || trustManager == null) {
                trustManager = createTrustManager();
                keyManager = createKeyManager();
                // secureRandom can be left as null
            }
            SslTransportFactory sslFactory = new SslTransportFactory();
            SslContext ctx = new SslContext(keyManager, trustManager, secureRandom);
            SslContext.setCurrentSslContext(ctx);
            return sslFactory.doConnect(brokerURL);
        } catch (Exception e) {
            throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e);
        }
    }
View Full Code Here

    protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException {

        if (brokerURI.getScheme().equals("ssl")) {
            // If given an SSL URI, use an SSL TransportFactory and configure
            // it to use the given key and trust managers.
            SslTransportFactory transportFactory = new SslTransportFactory();
           
            SslContext ctx = new SslContext(km, tm, random);
            SslContext.setCurrentSslContext(ctx);
            try {
                return transportFactory.doBind(brokerURI);
            } finally {
                SslContext.setCurrentSslContext(null);
            }
           
        } else {
View Full Code Here

            SecureRandom random) throws IOException, KeyManagementException {

        if (brokerURI.getScheme().equals("ssl")) {
            // If given an SSL URI, use an SSL TransportFactory and configure
            //      it to use the given key and trust managers.
            SslTransportFactory transportFactory = new SslTransportFactory();
            transportFactory.setKeyAndTrustManagers(km, tm, random);
           
            return transportFactory.doBind(getBrokerName(),brokerURI);
        } else {
            // Else, business as usual.
            return TransportFactory.bind(getBrokerName(), brokerURI);
        }
    }
View Full Code Here

        if (!brokerURL.getScheme().equals("ssl")) {
            return super.createTransport();
        }
       
        try {
            SslTransportFactory sslFactory = new SslTransportFactory();
            sslFactory.setKeyAndTrustManagers(keyManager, trustManager, secureRandom);
            return sslFactory.doConnect(brokerURL);
        } catch (Exception e) {
            throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e);
        }
    }
View Full Code Here

    protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException {

        if (brokerURI.getScheme().equals("ssl")) {
            // If given an SSL URI, use an SSL TransportFactory and configure
            // it to use the given key and trust managers.
            SslTransportFactory transportFactory = new SslTransportFactory();
           
            SslContext ctx = new SslContext(km, tm, random);
            SslContext.setCurrentSslContext(ctx);
            try {
                return transportFactory.doBind(brokerURI);
            } finally {
                SslContext.setCurrentSslContext(null);
            }
           
        } else {
View Full Code Here

    protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException {

        if (brokerURI.getScheme().equals("ssl")) {
            // If given an SSL URI, use an SSL TransportFactory and configure
            // it to use the given key and trust managers.
            SslTransportFactory transportFactory = new SslTransportFactory();
           
            SslContext ctx = new SslContext(km, tm, random);
            SslContext.setCurrentSslContext(ctx);
            try {
                return transportFactory.doBind(brokerURI);
            } finally {
                SslContext.setCurrentSslContext(null);
            }
           
        } else {
View Full Code Here

    protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException {

        if (brokerURI.getScheme().equals("ssl")) {
            // If given an SSL URI, use an SSL TransportFactory and configure
            // it to use the given key and trust managers.
            SslTransportFactory transportFactory = new SslTransportFactory();
            transportFactory.setKeyAndTrustManagers(km, tm, random);

            return transportFactory.doBind(brokerURI);
        } else {
            // Else, business as usual.
            return TransportFactory.bind(this, brokerURI);
        }
    }
View Full Code Here

    protected TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random) throws IOException, KeyManagementException {

        if (brokerURI.getScheme().equals("ssl")) {
            // If given an SSL URI, use an SSL TransportFactory and configure
            // it to use the given key and trust managers.
            SslTransportFactory transportFactory = new SslTransportFactory();
           
            SslContext ctx = new SslContext(km, tm, random);
            SslContext.setCurrentSslContext(ctx);
            try {
                return transportFactory.doBind(brokerURI);
            } finally {
                SslContext.setCurrentSslContext(null);
            }
           
        } else {
View Full Code Here

TOP

Related Classes of org.apache.activemq.transport.tcp.SslTransportFactory

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.