Using this site as a guide:
http://activemq.apache.org/how-do-i-use-ssl.html
I did the following (I added a bit to the keytool commands found within esite)
keytool -genkey -alias broker -keyalg RSA -keystore /home/amq/broker.ks -dname "CN=server, O=IBM, C=GB" -keypass passw0rd -storepass passw0rd
keytool -export -alias broker -keystore /home/amq/broker.ks -file /home/amq/broker_cert -storepass passw0rd
keytool -genkey -alias client -keyalg RSA -keystore /home/client/client.ks -dname "CN=client, O=IBM, C=GB" -keypass passw0rd -storepass passw0rd
keytool -import -alias broker -keystore /home/client/client.ts -file /home/amq/broker_cert -storepass passw0rd
keytool -export -alias client -keystore /home/client/client.ks -file /home/client/client_cert -storepass passw0rd
keytool -import -alias client -keystore /home/amq/broker.ts -file /home/client/client_cert -storepass passw0rd
Now the keystore and trust store has been created, I launched the broker
export SSL_OPTS=-Djavax.net.ssl.keyStore=/home/amq/broker.ks\ -Djavax.net.ssl.keyStorePassword=passw0rd\ -Djavax.net.ssl.trustStore=/home/amq/broker.ts
cd /usr/local/activemq/apache-activemq-5.9.0
bin/activemq console
So far so good, and what I want to do is take ProducerTool.java, which comes with the installation, and start it using SSL
I am a little puzzled by the documentation as shown below.
Using Spring to configure SSL for a broker instance
Sometimes using the properties of the javax.net.ssl system. * Not as they affect all SSL users in the JVM. ActiveMQ 5.2.x adds an element that allows the broker a specific set of SSL properties that need to be configured.
SslContext SSL , Xbean. SslContext :
<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>
SslContext SslTransportFactory . org.apache.activemq.spring.SpringSslContext
, , , JVM SSL, - Spring. ( , , )
2
1 > , - Spring, -Djava
2 > , ssl, ProducerTool.java . , , SSL borker, , .
1 > Spring, , JVM SSL
2 > ssl ProducerTool.java, , , SSL?