RFR: 8020207: jconsole fails connecting over SSL using service:jmx:rmi://...jndi...

Kevin Walls kevinw at openjdk.org
Sat Oct 11 11:52:01 UTC 2025


On Fri, 3 Oct 2025 12:00:13 GMT, GennadiyKrivoshein <duke at openjdk.org> wrote:

> This is the fix for the https://bugs.openjdk.org/browse/JDK-8020207, JConsole fails connecting over SSL using a string with a JMXServiceURL.
> 
> The cause of the issue is a connection to the RMI registry. If the registry and agent use SSLSockets and JConsole is trying to connect to the agent using "service:jmx:rmi..." URL, ProxyClient of the JConsole does not attempt to use SSL for communication with the registry, it always tries to connect using not secured Socket.
> 
> I would suggest to parse the JMXServiceURL and check the SSL config for the RMI registry for one specific case:
> 
> -  the schema of the JMXServiceURL is "rmi"
> -  the path of the JMXServiceURL is "/jndi/"
> -  the schema of the RMI registry URI is "rmi"
> -  the path of the RMI registry URI is "/jmxrmi".

Yes I think this looks good.

Thanks for confirming in the JBS issue that the SSL connections work if using host/port, but fail when giving the URL (I expect all connections, not just SSL).
Makes sense as in the other constructor above this change, we set registryHostname and registryPort from the details of the target.
It's good to have this work both ways!

-------------

Marked as reviewed by kevinw (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27622#pullrequestreview-3327015070


More information about the serviceability-dev mailing list