Skip to content

Conversation

@Hakky54
Copy link
Contributor

@Hakky54 Hakky54 commented Nov 20, 2025

Should resolve #894 and #834

@Hakky54 Hakky54 marked this pull request as draft November 20, 2025 15:22
Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
@Hakky54
Copy link
Contributor Author

Hakky54 commented Nov 20, 2025

@dhoard I attempted to add the possibility for configuring the ssl configuration for JmxScraper from the yaml file. The code changes for JmxScraper and JmxCollector seems ok to me, however I don't know how to properly test it to verify whether the configuration is really working as intended. Could you guide me for that part?

Next to that, I tried to add an integration test with the intention of covering this change, however I am not sure whether I did the adjustment correctly for the integration test. I added RMISSLFromYamlTest which is basically a copy of EnvironmentVariableRMISSLTest however I adjusted the yaml file which contains the following snippet:

hostPort: application:9999
ssl:
  enabled: true
  keyStore:
    type: PKCS12
    filename: localhost.pkcs12
    password: changeit
  trustStore:
    type: PKCS12
    filename: localhost.pkcs12
    password: changeit
username: ${USERNAME}
password: ${PASSWORD}
rules:
  - pattern: ".*"

With the snippet above I would expect that the JmxScraper would pick up these configurations. So I would assume

-Djavax.net.ssl.keyStore=localhost.pkcs12 \
-Djavax.net.ssl.keyStorePassword=changeit \
-Djavax.net.ssl.keyStoreType=pkcs12 \
-Djavax.net.ssl.trustStore=localhost.pkcs12 \
-Djavax.net.ssl.trustStorePassword=changeit \
-Djavax.net.ssl.trustStoreType=pkcs12 \

Is not needed in application.sh and exporter.sh however if I remove it the test is failing. Would you be able to point out which part I need to adjust to properly test these changes?

Update

I managed to make the test passing, added even an additional integration test. The current solution works with the existing yaml schema and also with the new schema containing the keystore/truststore path and passwords etc

@dhoard
Copy link
Collaborator

dhoard commented Nov 20, 2025

@Hakky54 I will be on PTO for a week, so won’t be able to review for a week.

Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
@Hakky54
Copy link
Contributor Author

Hakky54 commented Nov 20, 2025

Sure lets catch up when you are available again. Enjoy your days off

Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
@Hakky54 Hakky54 marked this pull request as ready for review November 20, 2025 21:21
Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
Signed-off-by: Hakky54 <hakangoudberg@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow config file to contain the keystore / truststore credentials when connecting via ssl to JMX

2 participants