To use mutual authentication, the server and agents must exchange keys. You export the server key (as a certificate) and import it into the agent keystore, then reverse the process by exporting the agent key and importing it into the server keystore. When using an agent relay, the relay must swap certificates with the server and with the remote agents that will use the relay.
Before exchanging keys, ensure that the following properties are set:
-
The
server.jms.mutualAuthproperty in the server'sinstalled.propertiesfile (located in theserver_install/conf/serverdirectory) is set to true. -
For each agent, the
locked/agent.mutual_authproperty in the agent'sinstalled.propertiesfile (located in theagent_install\conf\agentdirectory) is set to true. -
For each agent relay, the
agentrelay.jms_proxy.secureproperty in the relay'sagentrelay.propertiesfile (located in therelay_install\confdirectory) is set to true. -
For each agent relay, the
agentrelay.jms_proxy.mutualAuthproperty in the relay'sagentrelay.propertiesfile is set to true.
To exchange keys:
-
Open a shell and navigate to the server installation
confdirectory. -
Run:
keytool -export -keystore server.keystore -storepass changeit -alias server -file server.crt -
Copy the exported file (certificate) to the local agent/agent relay installation
confdirectory. -
Import the file by running from within the agent's
confdirectory (or agent relay'sjms-relaydirectory):keytool -import -keystore ud.keystore -storepass changeit -alias server -file server.crt -keypass changeit -nopromptYou should see the
Certificate was added to keystoremessage.Note
For agent relays, replace
ud.keystorewith the name of the relay's keystore--agentrelay.keystore -
For each local agent or agent relay , export the key by running the following (change the name of the file argument to match the agent name):
keytool -export -keystore ud.keystore -storepass changeit -alias ud_agent -file [agent_name].crtYou should see the
Certificate stored in file (agent_name.crt)message.Note
For agent relays, replace
ud.keystorewith the name of the relay's keystore--agentrelay.keystore -
Copy the exported file to the server's
confdirectory. -
From within the server's
confdirectory, import each certificate by running the following command (change the name of the file argument and alias to match the certificate's name):keytool -import -keystore ud.keystore -storepass changeit -alias [agent_name] -file [agent_name].crt -keypass changeit -nopromptYou should see the
Certificate was added to keystoremessage. -
Restart the server and agents/agent relays.
To connect an agent relay with the remote agents that will use it, swap certificates as explained above: each remote agent must import the certificate for the relay it will use, and the relay must import the certificate from each remote agent that will use it. Agents using relays do not have to swap certificates with the server.
To list the certificates loaded into a keystore, run the following from within the keystore directory:
keytool -list -keystore ud.keystore -storepass changeit

