Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded broker JMX support using GlassFish server secured RMI Registry #326

Open
glassfishrobot opened this issue Aug 2, 2013 · 6 comments

Comments

@glassfishrobot
Copy link

GF supports starting secured RMI Registry for JMX. In that case EMBEDDED broker can reuse it instead of starting its own to avoid opening extra port.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
Reported by liang.x.zhao

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
Issue-Links:
blocks
GLASSFISH-20707
GLASSFISH-20714

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
liang.x.zhao said:
The steps to enable secure jmx connector in GF:

asadmin set configs.config.server-config.admin-service.jmx-connector.system.security-enabled=true
asadmin change-admin-password (respond to the prompts)
asadmin enable-secure-admin
asadmin restart-domain (as prompted in the output from enable-secure-admin)
asadmin list-jms-resources (users first need to run any asadmin command that contacts the DAS which now has secure admin enabled. This caches the DAS cert in the local GlassFish truststore (in the ~/.gfclient/truststore file).)

jconsole -J-Djavax.net.ssl.trustStore=$

{HOME}

/.gfclient/truststore (Use Remote Process with URL "localhost:8686", and the admin username/passowrd).

You can refer to GLASSFISH-20671 for more details.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
@amykang2020 said:
added JMX support from broker to use GlassFish server secure rmi registry port, custom JMX clients can do following
to connect to the ssljmxrmi service of a JMSRA managed broker that uses GlassFish server secure rmi registry

env.put(JMXConnector.CREDENTIALS, credentials);
env.put("com.sun.jndi.rmi.factory.socket", new SslRMIClientSocketFactory());
final JMXServiceURL jmxURL = new JMXServiceURL(jmxServiceURL);
final JMXConnector jmxConnector = JMXConnectorFactory.connect(jmxURL, env);

where jmxServiceURL is the JMX service URL for broker ssljmxrmi service which can be obtained either from the broker log on startup or by getJMXServiceURL() method from com.sun.messaging.AdminConnectionConfiguration

1. Before start broker, run imqkeytool to setup keystore so that broker ssljmx service can use it
2. JMSRA need to pass the following to broker in order to have broker use GlassFish secure RMI registry port
-useRmiRegistry
-rmiRegistryPort
-Dimq.jmx.connector.activelist=ssljmxrmi <== This turns off broker jmxrmi service and enables ssljmxrmi service

as well as imq.keystore.password

3. JMX application client user needs to do following
a) Using Java keytool, import broker's certificate to $HOME/.gfclient/truststore
b) run JMX application client with Java system property
-Djavax.net.ssl.trustStore=$

{HOME}

/.gfclient/truststore

Because of a jconsole bug mentioned in GLASSFISH-20671, jconsole can not be used to access broker mbeans when broker uses GlassFish server secure RMI registry. Therefore, David, GlassFish JMS module should not make this a default, instead only turn it on when user wanted

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
This issue was imported from java.net JIRA MQ-326

@glassfishrobot
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants