According to the ActiveMQ Artemis documents it is possible to do 2 way TLS aka client certificate authentication using a trusted CA. See extract below.
Two-way TLS uses the same sslEnabled
, keyStorePath
, and keyStorePassword
properties as one-way TLS, but it adds needClientAuth=true
to tell the client it should present a certificate of its own. For example:
<acceptor name="artemis">tcp://0.0.0.0:61616?sslEnabled=true;keyStorePath=../etc/broker.keystore;keyStorePassword=1234!;needClientAuth=true</acceptor>
This configuration assumes that the client's certificate is signed by a trusted provider. If the client's certificate is not signed by a trusted provider (e.g. it is self-signed) then the server needs to import the client's certificate into a trust-store and configure the acceptor
with trustStorePath
and trustStorePassword
, e.g.:
<acceptor name="artemis">tcp://0.0.0.0:61616?sslEnabled=true;keyStorePath=../etc/broker.keystore;keyStorePassword=1234!</acceptor>
My requirements at the moment are full 2 way SSL with client getting their cert from our CA. According to the docs my understanding is that we would not need to add the keys of client to the trust store every time a user signs up. NOTE: we are doing this on the AMQP protocol.
On a high level the setup would be:
- Install CA into JRE
cacerts
keystore. - Create a signing request for the broker.
- CA creates certificate for broker.
- Install broker certificate into keystore (e.g.
etc/broker-certs.p12
) - Client creates cert signing request
- CA creates client certificate.
- Client presents certificate when connecting.
Before I go down the rabbit hole of SSL I wanted to check that if what I am trying to achieve is even possible?
I tried the ssl-enabled-dual-authentication
example however it is throwing an exception on launch of the client.
Caused by: org.apache.activemq.artemis.api.core.ActiveMQConnectionTimedOutException: AMQ219013: Timed out waiting to receive cluster topology. Group:null
FOR JDK 11+ Users: To try out the ssl-enabled-dual-authenticaion example you will need to recreate all the certificates. The comments sections has some more details.
needClientAuth=true
as well astrustStorePath
andtrustStorePassword
in your self-signedacceptor
example. – Justin Bertramssl-enabled-dual-authentication
on the currentmaster
branch as well as 2.17.0, 2.16.0, 2.15.0, 2.14.0, 2.13.0, & 2.12.0 and they all completed successfully with no exceptions. Perhaps something in your environment is messed up. – Justin Bertrammvn verify
will automatically create any necessary instances. I'm on Ubuntu as well, and I also just unzipped and ranmvn clean verify
. – Justin Bertrammvn -Prelease install
it reported the following:[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message: JDK 8 is required when building the release
. That is ok. I will use the example and run a local instance as I can stay on JDK11 for now. – Namphibian