Skip to content

Commit

Permalink
Clarify HTTP(S) upgrade config
Browse files Browse the repository at this point in the history
Demonstrate that the Artemis acceptor receiving HTTP(S) upgrade connections
doesn't need any SSL configuration.
  • Loading branch information
jbertram committed Oct 5, 2015
1 parent bfe2e05 commit b8e235f
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,27 @@ public NettyConnectorWithHTTPUpgradeTest(Boolean useSSL) {
@Before
public void setUp() throws Exception {
super.setUp();
HashMap<String, Object> httpParams = new HashMap<String, Object>();
HashMap<String, Object> httpAcceptorParams = new HashMap<String, Object>();
// This prop controls the usage of HTTP Get + Upgrade from Netty connector
httpParams.put(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, true);
httpParams.put(TransportConstants.PORT_PROP_NAME, HTTP_PORT);
if (useSSL) {
httpParams.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
httpParams.put(TransportConstants.KEYSTORE_PATH_PROP_NAME, SERVER_SIDE_KEYSTORE);
httpParams.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, PASSWORD);
httpParams.put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
httpParams.put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
}
httpAcceptorParams.put(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, true);
httpAcceptorParams.put(TransportConstants.PORT_PROP_NAME, HTTP_PORT);
acceptorName = randomString();

conf = createDefaultNettyConfig().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, httpParams, acceptorName));
conf = createDefaultNettyConfig().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, httpAcceptorParams, acceptorName));

server = addServer(ActiveMQServers.newActiveMQServer(conf, false));

server.start();
locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY, httpParams));

HashMap<String, Object> httpConnectorParams = new HashMap<String, Object>();
httpAcceptorParams.put(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, true);
httpAcceptorParams.put(TransportConstants.PORT_PROP_NAME, HTTP_PORT);
if (useSSL) {
httpAcceptorParams.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
httpAcceptorParams.put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, CLIENT_SIDE_TRUSTSTORE);
httpAcceptorParams.put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
}
locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NETTY_CONNECTOR_FACTORY, httpConnectorParams));
addServerLocator(locator);

// THe web server owns the HTTP port, not ActiveMQ Artemis.
Expand Down

0 comments on commit b8e235f

Please sign in to comment.