@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); }
/** * Creates a new SSL SocketFactory. The given factory will use user-provided * key and trust managers (if the user provided them). * * @return Newly created (Ssl)SocketFactory. * @throws IOException */ @Override protected SocketFactory createSocketFactory() throws IOException { if( SslContext.getCurrentSslContext()!=null ) { SslContext ctx = SslContext.getCurrentSslContext(); try { return ctx.getSSLContext().getSocketFactory(); } catch (Exception e) { throw IOExceptionSupport.create(e); } } else { return SSLSocketFactory.getDefault(); } }
/** * Creates a new SSL SocketFactory. The given factory will use user-provided * key and trust managers (if the user provided them). * * @return Newly created (Ssl)SocketFactory. * @throws IOException */ @Override protected SocketFactory createSocketFactory() throws IOException { if (SslContext.getCurrentSslContext() != null) { SslContext ctx = SslContext.getCurrentSslContext(); try { return ctx.getSSLContext().getSocketFactory(); } catch (Exception e) { throw IOExceptionSupport.create(e); } } else { return SSLSocketFactory.getDefault(); } }
/** * Creates a new SSL ServerSocketFactory. The given factory will use * user-provided key and trust managers (if the user provided them). * * @return Newly created (Ssl)ServerSocketFactory. * @throws IOException */ @Override protected ServerSocketFactory createServerSocketFactory() throws IOException { if( SslContext.getCurrentSslContext()!=null ) { SslContext ctx = SslContext.getCurrentSslContext(); try { return ctx.getSSLContext().getServerSocketFactory(); } catch (Exception e) { throw IOExceptionSupport.create(e); } } else { return SSLServerSocketFactory.getDefault(); } }
public FailoverTransport() { brokerSslContext = SslContext.getCurrentSslContext(); stateTracker.setTrackTransactions(true);
@Override public TransportServer doBind(final URI location) throws IOException { try { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); Map<String, Object> autoProperties = IntrospectionSupport.extractProperties(options, "auto."); this.enabledProtocols = AutoTransportUtils.parseProtocols((String) autoProperties.get("protocols")); ServerSocketFactory serverSocketFactory = createServerSocketFactory(); AutoTcpTransportServer server = createTcpTransportServer(location, serverSocketFactory); server.setWireFormatFactory(new OpenWireFormatFactory()); if (options.get("allowLinkStealing") != null){ allowLinkStealingSet = true; } IntrospectionSupport.setProperties(server, options); server.setAutoTransportOptions(IntrospectionSupport.extractProperties(options, "auto.")); server.setTransportOption(IntrospectionSupport.extractProperties(options, "transport.")); server.setWireFormatOptions(AutoTransportUtils.extractWireFormatOptions(options)); server.bind(); return server; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
/** * 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); } }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); } }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); } }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); } }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); } }
@Override public TransportServer doBind(URI location) throws IOException { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } return super.doBind(location); }
public TransportServer doBind(URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); HttpsTransportServer result = new HttpsTransportServer(location, this, SslContext.getCurrentSslContext()); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); result.setTransportOption(transportOptions); return result; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
public TransportServer doBind(URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); WSSTransportServer result = new WSSTransportServer(location, SslContext.getCurrentSslContext()); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, ""); result.setTransportOption(transportOptions); return result; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
@Override public TransportServer doBind(URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); HttpsTransportServer result = new HttpsTransportServer(location, this, SslContext.getCurrentSslContext()); Map<String, Object> httpOptions = IntrospectionSupport.extractProperties(options, "http."); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); result.setTransportOption(transportOptions); result.setHttpOptions(httpOptions); return result; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }