NO-JIRA Fix broker connection AMQP SSL example

This commit is contained in:
Domenico Francesco Bruscino 2021-09-02 16:41:36 +02:00 committed by Gary Tully
parent c0ce3ffdc6
commit 00d353e4f1
12 changed files with 7 additions and 7 deletions

View File

@ -85,7 +85,7 @@ under the License.
<ignore>${noServer}</ignore> <ignore>${noServer}</ignore>
<spawn>true</spawn> <spawn>true</spawn>
<location>${basedir}/target/server1</location> <location>${basedir}/target/server1</location>
<testURI>tcp://localhost:5771?sslEnabled=true;trustStorePath=target/server1/etc/activemq.example.truststore;trustStorePassword=activemqexample</testURI> <testURI>tcp://localhost:5771?sslEnabled=true;trustStorePath=target/server1/etc/server-ca-truststore.jks&amp;trustStorePassword=securepass</testURI>
<args> <args>
<param>run</param> <param>run</param>
</args> </args>
@ -101,7 +101,7 @@ under the License.
<spawn>true</spawn> <spawn>true</spawn>
<ignore>${noServer}</ignore> <ignore>${noServer}</ignore>
<location>${basedir}/target/server0</location> <location>${basedir}/target/server0</location>
<testURI>tcp://localhost:5671?sslEnabled=true;trustStorePath=target/server0/etc/activemq.example.truststore;trustStorePassword=activemqexample</testURI> <testURI>tcp://localhost:5671?sslEnabled=true;trustStorePath=target/server0/etc/server-ca-truststore.jks&amp;trustStorePassword=securepass</testURI>
<args> <args>
<param>run</param> <param>run</param>
</args> </args>

View File

@ -35,7 +35,7 @@ public class BrokerConnectionSenderSSL {
public static void main(final String[] args) throws Exception { public static void main(final String[] args) throws Exception {
Connection connectionOnServer0 = null; Connection connectionOnServer0 = null;
ConnectionFactory connectionFactoryServer0 = new JmsConnectionFactory("amqps://localhost:5671?transport.trustStoreLocation=target/server0/etc/activemq.example.truststore&transport.trustStorePassword=activemqexample"); ConnectionFactory connectionFactoryServer0 = new JmsConnectionFactory("amqps://localhost:5671?transport.trustStoreLocation=target/server0/etc/server-ca-truststore.jks&transport.trustStorePassword=securepass");
// Step 1. Create a connection on server0, and send a few messages // Step 1. Create a connection on server0, and send a few messages
try { try {
@ -58,7 +58,7 @@ public class BrokerConnectionSenderSSL {
// Step 2. create a connection on server1, and receive a few messages. // Step 2. create a connection on server1, and receive a few messages.
// the sender on the broker conneciton will take care of the transfer. // the sender on the broker conneciton will take care of the transfer.
Connection connectionOnServer1 = null; Connection connectionOnServer1 = null;
ConnectionFactory connectionFactoryServer1 = new JmsConnectionFactory("amqps://localhost:5771?transport.trustStoreLocation=target/server1/etc/activemq.example.truststore&transport.trustStorePassword=activemqexample"); ConnectionFactory connectionFactoryServer1 = new JmsConnectionFactory("amqps://localhost:5771?transport.trustStoreLocation=target/server0/etc/server-ca-truststore.jks&transport.trustStorePassword=securepass");
try { try {
connectionOnServer1 = connectionFactoryServer1.createConnection(); connectionOnServer1 = connectionFactoryServer1.createConnection();

View File

@ -32,11 +32,11 @@ under the License.
<acceptors> <acceptors>
<!-- keystores will be found automatically if they are on the classpath --> <!-- keystores will be found automatically if they are on the classpath -->
<!-- The CORE protocol only used for artemis-maven-plugin verifying the server is up for example to start --> <!-- The CORE protocol only used for artemis-maven-plugin verifying the server is up for example to start -->
<acceptor name="netty-ssl-acceptor">tcp://localhost:5671?sslEnabled=true;keyStorePath=activemq.example.keystore;keyStorePassword=activemqexample;protocols=AMQP,CORE</acceptor> <acceptor name="netty-ssl-acceptor">tcp://localhost:5671?sslEnabled=true;keyStorePath=server-keystore.jks;keyStorePassword=securepass;protocols=AMQP,CORE</acceptor>
</acceptors> </acceptors>
<broker-connections> <broker-connections>
<amqp-connection uri="tcp://localhost:5771?sslEnabled=true;verifyHost=true;trustStorePath=activemq.example.truststore;trustStorePassword=activemqexample" name="otherBrokerSSL" retry-interval="1000"> <amqp-connection uri="tcp://localhost:5771?sslEnabled=true;verifyHost=true;trustStorePath=server-ca-truststore.jks;trustStorePassword=securepass" name="otherBrokerSSL" retry-interval="1000">
<sender address-match="#"/> <sender address-match="#"/>
</amqp-connection> </amqp-connection>
</broker-connections> </broker-connections>

View File

@ -32,7 +32,7 @@ under the License.
<acceptors> <acceptors>
<!-- keystores will be found automatically if they are on the classpath --> <!-- keystores will be found automatically if they are on the classpath -->
<!-- The CORE protocol only used for artemis-maven-plugin verifying the server is up for example to start --> <!-- The CORE protocol only used for artemis-maven-plugin verifying the server is up for example to start -->
<acceptor name="netty-ssl-acceptor">tcp://localhost:5771?sslEnabled=true;keyStorePath=activemq.example.keystore;keyStorePassword=activemqexample;protocols=AMQP,CORE</acceptor> <acceptor name="netty-ssl-acceptor">tcp://localhost:5771?sslEnabled=true;keyStorePath=server-keystore.jks;keyStorePassword=securepass;protocols=AMQP,CORE</acceptor>
</acceptors> </acceptors>
<!-- Other config --> <!-- Other config -->