Setting up the Key and Trust StoresAlso see Tomcat's SSL instructions
Starting the BrokerUsing the javax.net.ssl.* System PropertiesBefore starting the broker's VM set the SSL_OPTS enviorment variable so that it knows to use the broker keystore. export SSL_OPTS = -Djavax.net.ssl.keyStore=/path/to/broker.ks -Djavax.net.ssl.keyStorePassword=password Using Spring to configure SSL for a Broker instanceSometimes the use of javax.net.ssl.* system properties is not appropriate as they effect all SSL users in a JVM. ActiveMQ 5.2.x adds an <sslContext> element to the <amq:broker> that allows a broker specific set of SSL properties to be configured. The sslContext test case <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <!-- lets create an embedded ActiveMQ Broker --> <amq:broker useJmx="false" persistent="false"> <amq:sslContext> <amq:sslContext keyStore="server.keystore" keyStorePassword="password" trustStore="client.keystore" trustStorePassword="password"/> </amq:sslContext> <amq:transportConnectors> <amq:transportConnector uri="ssl://localhost:61616" /> </amq:transportConnectors> </amq:broker> </beans> The sslContext is used to configure the SslTransportFactory Starting the ClientWhen starting the client's VM, specify the following system properties: javax.net.ssl.keyStore=/path/to/client.ks javax.net.ssl.keyStorePassword=password javax.net.ssl.trustStore=/path/to/client.ts
Client certificatesIf you want to verify client certificates, you need to take a few extra steps:
Useful linksThese links might also help |