Enable JMX Authentication and SSL For Mule Runtime
This brief article includes a tutorial that shows how to enable SSL for on-premise Mule runtimes.
Join the DZone community and get the full member experience.
Join For FreeIn my previous article, I demonstrated how to change the Mule application logging level dynamically by using JMX MBeans. In that article, I skipped the procedure on how to enable SSL for JMX of Mule runtimes. Apparently, in the production environment, we will need to enable both authentication and SSL for the security purpose.
I will demonstrate the details about enabling SSL for on-premises Mule Runtimes. I will use local generated Cert for demonstration purpose. You may need to authorize the cert for your organization, but the basic procedures are the same.
On the Mule runtime server, execute the following commands:
mkdir ${MULE_HOME}/ssl
cd ${MULE_HOME}/ssl
keytool -genkey -alias tc401 -keyalg RSA -keystore tc401_keystore.jks
keytool -export alias tc401 -file tc401_cert -keystore tc401_keystore.jks
keytool -import -alias tc401 -keystore tc401_truststore.jks -file tc401_cert
The above commands will create keystore and truststore, which will be used by Mule Runtimes. To instruct a Mule Runtime to use the keystore and truststore, we need to update wrapper.conf file.
Add the following lines to ${MULE_HOME}/conf/wrapper.conf
wrapper.java.additional.50=-Dcom.sun.management.jmxremote=true
wrapper.java.additional.51=-Dcom.sun.management.jmxremote.port=1099
wrapper.java.additional.53=-Dcom.sun.management.jmxremote.access.file=%MULE_HOME%/conf/jmxremote.access
wrapper.java.additional.54=-Dcom.sun.management.jmxremote.password.file=%MULE_HOME%/conf/jmxremote.password
wrapper.java.additional.56=-Dcom.sun.management.jmxremote.authenticate=true
wrapper.java.additional.57=-Dcom.sun.management.jmxremote.ssl=true
wrapper.java.additional.58=-Djavax.net.ssl.keyStore=%MULE_HOME%/ssl/tc401_keystore.jks
wrapper.java.additional.59=-Djavax.net.ssl.keyStorePassword=changeme
wrapper.java.additional.60=-Djavax.net.ssl.trustStore=%MULE_HOME%/ssl/tc401_keystore.jks
wrapper.java.additional.61=-Djavax.net.ssl.trustStorePassword=changeme
Note that I use jmxremote.access and jmxremote.password for the user permission and authentication. The details can be referred to in my last article.
jvisualvm -J-Djavax.net.ssl.trustStore=./tc401_truststore.jks -J-Djavax.net.ssl.trustStorePassword=changeme
The following snapshots show how the page of login with SSL is enabled.

Published at DZone with permission of Gary Liu, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Why You Should Consider Using React Router V6: An Overview of Changes
-
Microservices: Quarkus vs Spring Boot
-
Implementing RBAC in Quarkus
-
JSON to PDF Magic: Harnessing LaTeX and JSON for Effortless Customization and Dynamic PDF Generation
Comments