Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions collector/src/main/java/io/prometheus/jmx/JmxScraper.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public void doScrape() throws Exception {

SslRMIClientSocketFactory clientSocketFactory = new SslRMIClientSocketFactory();
environment.put(
RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, clientSocketFactory);
RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE,
clientSocketFactory);
if (!"true".equalsIgnoreCase(System.getenv("RMI_REGISTRY_SSL_DISABLED"))) {
environment.put("com.sun.jndi.rmi.factory.socket", clientSocketFactory);
}
Expand Down Expand Up @@ -200,9 +201,11 @@ public void doScrape() throws Exception {
}

/**
* Attempts to resolve the ssl configuration defined in the yaml file
* Next to that it also attempts to read the following system properties:
* Attempts to resolve the ssl configuration defined in the yaml file Next to that it also
* attempts to read the following system properties:
*
* <p>
*
* <pre>
* - javax.net.ssl.keyStore
* - javax.net.ssl.keyStorePassword
Expand Down Expand Up @@ -238,7 +241,8 @@ private SSLFactory createSslFactory() {
sslFactoryBuilder.withCiphers(sslProperties.ciphers.toArray(new String[0]));
}

callSafely(sslFactoryBuilder::withSystemPropertyDerivedIdentityMaterial,
callSafely(
sslFactoryBuilder::withSystemPropertyDerivedIdentityMaterial,
sslFactoryBuilder::withSystemPropertyDerivedTrustMaterial,
sslFactoryBuilder::withSystemPropertyDerivedProtocols,
sslFactoryBuilder::withSystemPropertyDerivedCiphers);
Expand All @@ -250,7 +254,8 @@ private void callSafely(Callable<?>... callables) {
for (Callable<?> callable : callables) {
try {
callable.call();
} catch (Exception ignored) {}
} catch (Exception ignored) {
}
}
}

Expand Down