Reputation: 358
I have connected a JMX connection from a machine without SSL. But when I give the SSL though the App is getting launched without any error, VisualVM is unable to establish a JMX connection through the specified port. Following is the command I used to establish JMX connection from the App side.
java -Dcom.sun.management.jmxremote.port=4444 -Dcom.sun.management.jmxremote.password.file="C:/Program Files/Java/jre1.8.0_25/lib/management/jmxremote.password" -Djavax.net.ssl.keyStore="C:/Program Files/Java/jdk1.8.0_25/bin/testkeystore" -Djavax.net.ssl.keyStorePassword=123456 -Dcom.sun.management.jmxremote.ssl=true -Dcom.sun.management.jmxremote.authenticate=true DemoApp
Please advice.
Upvotes: 1
Views: 1995
Reputation: 355
Even though this is a quite old question, @Klara's comments helped me to solve the similar issue very fast.
keytool -exportcert -alias server -keystore /jkslocation/serverKS.jks -storepass storepassword -file /certificatelocation/certificate.cer
Then I added exported certificate to the trust store: keytool -import -alias server -keystore /jkslocation/clientTS.jks -storepass storepassword -file /certificatelocation/certificate.cer -v
Then clientTS.jks is copied to the client machine running jVisualVM.
jVisualVM is started with trust store parameters: ./jvisualvm -J-Djavax.net.ssl.trustStore=clientTS.jks -J-Djavax.net.ssl.trustStorePassword=clientTSPassword
jVisualVM can access server JMX ports.
Upvotes: 2