Ask Your Question
3

How can one establish an SSL connection with self-signed certificates to ActiveMQ "Classic"?

asked 2023-01-25 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-02-12 18:00:00 +0000

lalupa gravatar image

To establish an SSL connection with self-signed certificates to ActiveMQ "Classic", follow these steps:

  1. Generate a Keystore:

The first step is to generate a keystore that will hold the SSL certificate for the broker. You can use the following command to create a keystore called broker.ks:

-genkey -alias broker -keystore broker.ks -keyalg RSA

  1. Create a Self-signed Certificate:

Once you have created the keystore, you need to create a self-signed certificate to go with it. You can use the following command to create a self-signed certificate:

-selfcert -alias broker -keystore broker.ks

  1. Configure ActiveMQ for SSL:

To configure ActiveMQ to use SSL, you need to modify the ActiveMQ configuration file. Set the following properties in the activemq.xml file:

    <broker useJmx="true" xmlns="http://activemq.apache.org/schema/core">
        <sslContext>
            <sslContext keyStore="broker.ks" keyStorePassword="password" />
        </sslContext>
        <transportConnectors>
            <transportConnector name="ssl" uri="ssl://0.0.0.0:61617?needClientAuth=true" />
        </transportConnectors>
    </broker>

This tells ActiveMQ to use the broker.ks keystore for SSL and to listen on the SSL transportConnector.

  1. Configure the Client for SSL:

To connect to ActiveMQ over SSL, you need to configure your client to use SSL as well. For example, if you are using the ActiveMQ C++ client library, you can use the following code to connect:

::ConnectionFactory* connectionFactory = new cms::ActiveMQConnectionFactory( "ssl://localhost:61617?wireFormat=stomp", "admin", "password");

This sets the URI for the SSL connection to point to the broker and tells it to use the Stomp wire format.

That's it! You should now have an SSL connection with self-signed certificates to ActiveMQ "Classic".

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-01-25 11:00:00 +0000

Seen: 8 times

Last updated: Feb 12 '22