Skip to content

Commit 4e063c4

Browse files
add README
1 parent 0afaee0 commit 4e063c4

File tree

8 files changed

+32
-9
lines changed

8 files changed

+32
-9
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JmxClientFeature.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ private static void configureJNI() {
7070
* </ul>
7171
*/
7272
private static void configureReflection(BeforeAnalysisAccess access) {
73+
RuntimeReflection.register(access.findClassByName("com.sun.jndi.url.rmi.rmiURLContextFactory"));
74+
RuntimeReflection.register(access.findClassByName("sun.rmi.server.UnicastRef"));
75+
7376
RuntimeReflection.register(access.findClassByName("com.sun.jmx.remote.protocol.rmi.ClientProvider"));
7477
RuntimeReflection.register(access.findClassByName("com.sun.jndi.url.rmi.rmiURLContextFactory").getConstructors());
7578
RuntimeReflection.register(access.findClassByName("sun.rmi.server.UnicastRef").getConstructors());

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JmxServerFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private static void registerJMXAgentResources() {
8383
"jdk.internal.agent.resources.agent");
8484

8585
resourcesRegistry.addResourceBundles(ConfigurationCondition.alwaysTrue(),
86-
"sun.security.util.Resources"); // required for password auth
86+
"sun.security.util.resources.security"); // required for password auth
8787
}
8888

8989
private static void configureProxy(BeforeAnalysisAccess access) {

substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jmx/JmxTest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2022, 2022, Red Hat Inc. All rights reserved.
2+
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2022, 2025, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -108,11 +108,7 @@ public static void checkForJFR() throws IOException {
108108

109109
/*
110110
* The following are dummy SSL keystore and truststore files required for testing connection
111-
* using SSL. The clientkeystore was used to create a client certificate
112-
* (jmxremoteresources/client.cer) which was then imported into the servertruststore. The
113-
* client key was created with the following properties: -alias clientkey -validity 99999
114-
* -storepass clientpass -keypass clientpass -keyalg rsa (The validity is from March 28
115-
* 2023).
111+
* using SSL. See jmxremoteresources/README.md for more information.
116112
*/
117113
System.setProperty(KEYSTORE_PROPERTY, JMX_REMOTE_RESOURCES + "/clientkeystore");
118114
System.setProperty(KEYSTORE_PASSWORD_PROPERTY, "clientpass");
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Remote JMX SSL and Authentication Supporting Files
2+
In order for the remote JMX password authentication and SSL to work a few files need to be created.
3+
4+
### Password Authentication
5+
Create the file `jmxremote.access`. In it add the line: `myrole readwrite`. This specifies a role with the read and write permissions.
6+
7+
Next, create the file `jmxremote.password`. In it add the line: `myrole MYP@SSWORD`. This specifies a password for the previously created role. This password will automatically be hashed and updated in the file once the first connection is made. No further action is needed.
8+
9+
### SSL
10+
Make the client keystore and client key.
11+
```
12+
keytool -genkeypair -keystore clientkeystore -alias clientkey -validity 99999 -storepass clientpass -keypass clientpass -keyalg rsa
13+
```
14+
15+
Create the client certificate file so that we can put in the server's truststore later.
16+
```
17+
keytool -exportcert -keystore clientkeystore -alias clientkey -storepass clientpass -file client.cer
18+
```
19+
20+
Put the client's certificate in the server's truststore (also creating the truststore).
21+
```
22+
keytool -importcert -file client.cer -keystore servertruststore -storepass servertrustpass
23+
```
24+

substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jmx/jmxremoteresources/jmxremote.password

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# with a clear text password or a new hashed password. If the new password is in clear,
44
# it will be replaced with its hash when a new login attempt is made.
55

6-
myrole GfD4DqNr5DUGl/kAREAAInPST5FKFI5i8lRpkscwOLC/sf5U25M8zn5ppOJGOAE6cOMPrgy3o+9f2PyL2PkE7w== m4maFV8JvmL1kByz6gLLiWSdYgtb1ezEfPseDllMwnGmWFBT6jquuxqa9pqrSmpBdMGfxa9gYdCecffS29XSXQ== SHA3-512
6+
myrole SviFJQFExpUO9PA5zucaZSkdrPJHwpyCHMrVa8fRhP+LrD9QoKE9HXP1qSWntrbYUwnacGzUYs7c2ZoebZ1feQ== D87Gcz5VU9d+casZg6P/WHh9AQU0n08dKwm7EAA/P47pdgPA1CO+zZIP7Y54LxgRKh6MpsAsSFXpjjaXzKCHuA== SHA3-512

0 commit comments

Comments
 (0)