Skip to content

Commit 8c63c6d

Browse files
committed
add option to toggle ssh on target JVM
1 parent 4cae820 commit 8c63c6d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/TestAppContainer.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class TestAppContainer extends GenericContainer<TestAppContainer> {
2727
private final Map<String, String> properties;
2828
private String login;
2929
private String pwd;
30+
private boolean jmxSsl;
3031

3132
public TestAppContainer() {
3233
super("openjdk:8u272-jre-slim");
@@ -61,10 +62,15 @@ public TestAppContainer withUserAuth(String login, String pwd) {
6162
return this;
6263
}
6364

65+
@CanIgnoreReturnValue
66+
public TestAppContainer withJmxSsl() {
67+
this.jmxSsl = true;
68+
return this;
69+
}
70+
6471
@Override
6572
public void start() {
66-
// TODO: add support for ssl
67-
properties.put("com.sun.management.jmxremote.ssl", "false");
73+
properties.put("com.sun.management.jmxremote.ssl", Boolean.toString(jmxSsl));
6874

6975
if (pwd == null) {
7076
properties.put("com.sun.management.jmxremote.authenticate", "false");

0 commit comments

Comments
 (0)