private boolean isSSL(ConnectionContext context, ConnectionInfo info) throws Exception { boolean sslCapable = false; Connector connector = context.getConnector(); if (connector instanceof TransportConnector) { TransportConnector transportConnector = (TransportConnector) connector; sslCapable = transportConnector.getServer().isSslServer(); } // AMQ-5943, also check if transport context carries X509 cert if (!sslCapable && info.getTransportContext() instanceof X509Certificate[]) { sslCapable = true; } return sslCapable; }
if (context.getConnector() instanceof TransportConnector && ((TransportConnector) context.getConnector()).getPublishableConnectString() != null) { url = ((TransportConnector) context.getConnector()).getPublishableConnectString(); } else if (getBrokerService().getDefaultSocketURIString() != null) { url = getBrokerService().getDefaultSocketURIString();
/** * Check if the connection is pass through. * Pass through connection is a connection with null connector (Advisory topic connection) or embedded broker connection (connection string starts by vm://) * * @param context * @return */ private boolean isPassThroughConnection(ConnectionContext context) { if (context != null) { if (context.getConnector() == null || CONNECTOR_NAME_VM.equals(((TransportConnector) context.getConnector()).getName())) { return true; } // network connector if (context.getConnection().isNetworkConnection()) { return true; } } return false; }
private boolean isSSL(ConnectionContext context, ConnectionInfo info) throws Exception { boolean sslCapable = false; Connector connector = context.getConnector(); if (connector instanceof TransportConnector) { TransportConnector transportConnector = (TransportConnector) connector; sslCapable = transportConnector.getServer().isSslServer(); } // AMQ-5943, also check if transport context carries X509 cert if (!sslCapable && info.getTransportContext() instanceof X509Certificate[]) { sslCapable = true; } return sslCapable; }
boolean isAuthorizedVmConnection(ConnectionContext connectionContext, ConnectionInfo connectionInfo) { if (connectionInfo.getUserName() == null && connectionInfo.getPassword() == null) { Connector connector = connectionContext.getConnector(); if (connector instanceof TransportConnector) { TransportConnector transportConnector = (TransportConnector) connector; String connectorName = transportConnector.getName(); if (connectorName != null && !connectorName.isEmpty()) { if (connectorName.startsWith("vm://")) { log.debug("isAuthorizedVmConnection(ConnectionContext, ConnectionInfo) returning true for connectorName={}", connectorName); return true; } } } } log.debug("isAuthorizedVmConnection(ConnectionContext, ConnectionInfo) returning false for {}", connectionContext.getBroker().getVmConnectorURI()); return false; } }
private boolean isSSL(ConnectionContext context, ConnectionInfo info) throws Exception { boolean sslCapable = false; Connector connector = context.getConnector(); if (connector instanceof TransportConnector) { TransportConnector transportConnector = (TransportConnector) connector; sslCapable = transportConnector.getServer().isSslServer(); } // AMQ-5943, also check if transport context carries X509 cert if (!sslCapable && info.getTransportContext() instanceof X509Certificate[]) { sslCapable = true; } return sslCapable; }
private boolean isSSL(ConnectionContext context, ConnectionInfo info) throws Exception { boolean sslCapable = false; Connector connector = context.getConnector(); if (connector instanceof TransportConnector) { TransportConnector transportConnector = (TransportConnector) connector; sslCapable = transportConnector.getServer().isSslServer(); } // AMQ-5943, also check if transport context carries X509 cert if (!sslCapable && info.getTransportContext() instanceof X509Certificate[]) { sslCapable = true; } return sslCapable; }
/** * Overriding removeConnection to make sure the security context is cleaned. */ public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { boolean isSSL; Connector connector = context.getConnector(); if (connector instanceof ManagedTransportConnector) { ManagedTransportConnector managedTransportConnector = (ManagedTransportConnector) connector; isSSL = (managedTransportConnector.getServer() instanceof SslTransportServer); } else { isSSL = false; } super.removeConnection(context, info, error); if (isSSL) { this.sslBroker.removeConnection(context, info, error); } else { this.nonSslBroker.removeConnection(context, info, error); } } }
/** * Overridden to allow for authentication using different Jaas * configurations depending on if the connection is SSL or not. * * @param context The context for the incoming Connection. * @param info The ConnectionInfo Command representing the incoming * connection. */ public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { if (context.getSecurityContext() == null) { boolean isSSL; Connector connector = context.getConnector(); if (connector instanceof TransportConnector) { TransportConnector transportConnector = (TransportConnector) connector; isSSL = (transportConnector.getServer() instanceof SslTransportServer); } else { isSSL = false; } if (isSSL) { this.sslBroker.addConnection(context, info); } else { this.nonSslBroker.addConnection(context, info); } super.addConnection(context, info); } }
kcc.update(accessToken, account.getName(), accessToken.getScopeId(), accessToken.getUserId(), (((TransportConnector) context.getConnector()).getName()), brokerIpResolver.getBrokerIpOrHostName(), MULTI_ACCOUNT_CLIENT_ID); kcc.updateOldConnectionId(CONNECTION_MAP.get(kcc.getFullClientId()));
if (context.getConnector() instanceof TransportConnector && ((TransportConnector) context.getConnector()).getPublishableConnectString() != null) { url = ((TransportConnector) context.getConnector()).getPublishableConnectString(); } else if (getBrokerService().getDefaultSocketURIString() != null) { url = getBrokerService().getDefaultSocketURIString();
if (context.getConnector() instanceof TransportConnector && ((TransportConnector) context.getConnector()).getPublishableConnectString() != null) { url = ((TransportConnector) context.getConnector()).getPublishableConnectString(); } else if (getBrokerService().getDefaultSocketURIString() != null) { url = getBrokerService().getDefaultSocketURIString();
if (context.getConnector() instanceof TransportConnector && ((TransportConnector) context.getConnector()).getPublishableConnectString() != null) { url = ((TransportConnector) context.getConnector()).getPublishableConnectString(); } else if (getBrokerService().getDefaultSocketURIString() != null) { url = getBrokerService().getDefaultSocketURIString();