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

add trustStore and needClientAuth config to yaml (#834) #1118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gtully
Copy link
Contributor

@gtully gtully commented Jan 14, 2025

@dhoard I am making use of the custom authenticator and want to grant permissions based on the clients certificate so I need to be able to configure needClientAuth on the ssl parameters. Also, in kube land, I need to be able to configure the key and trust store types to support PEM key stores. Having these exposed in the yaml config leaves the system properties free for others.

From what I understand, this additional truststore config will also help with #834

@gtully
Copy link
Contributor Author

gtully commented Jan 14, 2025

peeking at that test failure.. sorted!

@gtully
Copy link
Contributor Author

gtully commented Jan 14, 2025

if it helps, for some context, the yaml for this use case is produced at: https://github.com/gtully/activemq-artemis-operator/blob/_jmx_exporter_agent/controllers/activemqartemis_reconciler.go#L2096

Comment on lines +133 to +137
try {
HttpResponse httpResponse = HttpClient.sendRequest(url);
throw new AssertionFailedError("expected exception on no client cert");
} catch (Exception expectedOnNoClientCert) {
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to use Assertj assertThatExceptionOfType

km.getKeyManagers(), tm.getTrustManagers(), new java.security.SecureRandom());

return sslContext;
} catch (IOException
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we catching exceptions and logging them?

@@ -0,0 +1,277 @@
/*
* Copyright (C) 2023-present The Prometheus jmx_exporter Authors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the copyright year since this is a new file.

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.

2 participants