public static TransportServer bind(BrokerService brokerService, URI location) throws IOException { TransportFactory tf = TransportFactory.findTransportFactory(location); if( brokerService!=null && tf instanceof BrokerServiceAware) { ((BrokerServiceAware)tf).setBrokerService(brokerService); } try { if( brokerService!=null ) { SslContext.setCurrentSslContext(brokerService.getSslContext()); } return tf.doBind(location); } finally { SslContext.setCurrentSslContext(null); } }
SslContext.setCurrentSslContext(ctx); try { return transportFactory.doBind(brokerURI); } finally { SslContext.setCurrentSslContext(null);
SslContext.setCurrentSslContext(getSslContext()); } else { SslContext.setCurrentSslContext(getBrokerService().getSslContext()); SslContext.setCurrentSslContext(null);
/** * Overriding to make special considerations for SSL connections. If we are * not using SSL, the superclass's method is called. If we are using SSL, an * SslConnectionFactory is used and it is given the needed key and trust * managers. * * @author sepandm@gmail.com */ @Override protected Transport createTransport() throws JMSException { SslContext existing = SslContext.getCurrentSslContext(); try { if (keyStore != null || trustStore != null) { keyManager = createKeyManager(); trustManager = createTrustManager(); } if (keyManager != null || trustManager != null) { SslContext.setCurrentSslContext(new SslContext(keyManager, trustManager, secureRandom)); } return super.createTransport(); } catch (Exception e) { throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e); } finally { SslContext.setCurrentSslContext(existing); } }
if (connectedTransportURI != null && !connectedTransportURI.equals(uri)) { try { SslContext.setCurrentSslContext(brokerSslContext); BackupTransport bt = new BackupTransport(this); bt.setUri(uri); LOG.debug("Failed to build backup ", e); } finally { SslContext.setCurrentSslContext(null);
SslContext.setCurrentSslContext(brokerSslContext); SslContext.setCurrentSslContext(null);
/** * * @param km * @param tm * @param random * @deprecated "Do not use anymore... using static initializers like this method only allows the JVM to use 1 SSL configuration per broker." * @see org.apache.activemq.broker.SslContext#setCurrentSslContext(SslContext) * @see org.apache.activemq.broker.SslContext#getSSLContext() */ public void setKeyAndTrustManagers(KeyManager[] km, TrustManager[] tm, SecureRandom random) { SslContext ctx = new SslContext(km, tm, random); SslContext.setCurrentSslContext(ctx); }
public static TransportServer bind(BrokerService brokerService, URI location) throws IOException { TransportFactory tf = TransportFactory.findTransportFactory(location); if( brokerService!=null && tf instanceof BrokerServiceAware) { ((BrokerServiceAware)tf).setBrokerService(brokerService); } try { if( brokerService!=null ) { SslContext.setCurrentSslContext(brokerService.getSslContext()); } return tf.doBind(location); } finally { SslContext.setCurrentSslContext(null); } }
public static TransportServer bind(BrokerService brokerService, URI location) throws IOException { TransportFactory tf = TransportFactory.findTransportFactory(location); if( brokerService!=null && tf instanceof BrokerServiceAware) { ((BrokerServiceAware)tf).setBrokerService(brokerService); } try { if( brokerService!=null ) { SslContext.setCurrentSslContext(brokerService.getSslContext()); } return tf.doBind(location); } finally { SslContext.setCurrentSslContext(null); } }
public static TransportServer bind(BrokerService brokerService, URI location) throws IOException { TransportFactory tf = TransportFactory.findTransportFactory(location); if( brokerService!=null && tf instanceof BrokerServiceAware) { ((BrokerServiceAware)tf).setBrokerService(brokerService); } try { if( brokerService!=null ) { SslContext.setCurrentSslContext(brokerService.getSslContext()); } return tf.doBind(location); } finally { SslContext.setCurrentSslContext(null); } }
public static TransportServer bind(BrokerService brokerService, URI location) throws IOException { TransportFactory tf = findTransportFactory(location); if( brokerService!=null && tf instanceof BrokerServiceAware ) { ((BrokerServiceAware)tf).setBrokerService(brokerService); } try { if( brokerService!=null ) { SslContext.setCurrentSslContext(brokerService.getSslContext()); } return tf.doBind(location); } finally { SslContext.setCurrentSslContext(null); } }
SslContext.setCurrentSslContext(ctx); try { return transportFactory.doBind(brokerURI); } finally { SslContext.setCurrentSslContext(null);
SslContext.setCurrentSslContext(ctx); try { return transportFactory.doBind(brokerURI); } finally { SslContext.setCurrentSslContext(null);
SslContext.setCurrentSslContext(ctx); try { return transportFactory.doBind(brokerURI); } finally { SslContext.setCurrentSslContext(null);
SslContext.setCurrentSslContext(ctx); try { return transportFactory.doBind(brokerURI); } finally { SslContext.setCurrentSslContext(null);
if (connectedTransportURI != null && !connectedTransportURI.equals(uri)) { try { SslContext.setCurrentSslContext(brokerSslContext); BackupTransport bt = new BackupTransport(this); bt.setUri(uri); LOG.debug("Failed to build backup ", e); } finally { SslContext.setCurrentSslContext(null);
/** * Overriding to make special considerations for SSL connections. If we are * not using SSL, the superclass's method is called. If we are using SSL, an * SslConnectionFactory is used and it is given the needed key and trust * managers. * * @author sepandm@gmail.com */ @Override protected Transport createTransport() throws JMSException { SslContext existing = SslContext.getCurrentSslContext(); try { if (keyStore != null || trustStore != null) { keyManager = createKeyManager(); trustManager = createTrustManager(); } if (keyManager != null || trustManager != null) { SslContext.setCurrentSslContext(new SslContext(keyManager, trustManager, secureRandom)); } return super.createTransport(); } catch (Exception e) { throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e); } finally { SslContext.setCurrentSslContext(existing); } }
/** * Overriding to make special considerations for SSL connections. If we are * not using SSL, the superclass's method is called. If we are using SSL, an * SslConnectionFactory is used and it is given the needed key and trust * managers. * * @author sepandm@gmail.com */ @Override protected Transport createTransport() throws JMSException { SslContext existing = SslContext.getCurrentSslContext(); try { if (keyStore != null || trustStore != null) { keyManager = createKeyManager(); trustManager = createTrustManager(); } if (keyManager != null || trustManager != null) { SslContext.setCurrentSslContext(new SslContext(keyManager, trustManager, secureRandom)); } return super.createTransport(); } catch (Exception e) { throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e); } finally { SslContext.setCurrentSslContext(existing); } }
/** * Overriding to make special considerations for SSL connections. If we are * not using SSL, the superclass's method is called. If we are using SSL, an * SslConnectionFactory is used and it is given the needed key and trust * managers. * * @author sepandm@gmail.com */ @Override protected Transport createTransport() throws JMSException { SslContext existing = SslContext.getCurrentSslContext(); try { if (keyStore != null || trustStore != null) { keyManager = createKeyManager(); trustManager = createTrustManager(); } if (keyManager != null || trustManager != null) { SslContext.setCurrentSslContext(new SslContext(keyManager, trustManager, secureRandom)); } return super.createTransport(); } catch (Exception e) { throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e); } finally { SslContext.setCurrentSslContext(existing); } }
/** * Overriding to make special considerations for SSL connections. If we are * not using SSL, the superclass's method is called. If we are using SSL, an * SslConnectionFactory is used and it is given the needed key and trust * managers. * * @author sepandm@gmail.com */ protected Transport createTransport() throws JMSException { // If the given URI is non-ssl, let superclass handle it. if (!brokerURL.getScheme().equals("ssl")) { return super.createTransport(); } try { 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); } }