Skip to content

Commit

Permalink
review remarks
Browse files Browse the repository at this point in the history
Signed-off-by: rs-eliatra <rafal.stobiecki@eliatra.com>
  • Loading branch information
rs-eliatra committed Mar 2, 2022
1 parent 426c6bf commit 95322de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public static int execute(final String[] args) throws Exception {
options.addOption(Option.builder("kspass").longOpt("keystore-password").hasArg().argName("password").desc("Keystore password").build());
options.addOption(Option.builder("cd").longOpt("configdir").hasArg().argName("directory").desc("Directory for config files").build());
options.addOption(Option.builder("h").longOpt("hostname").hasArg().argName("host").desc("OpenSearch host (default: localhost)").build());
options.addOption(Option.builder("p").longOpt("port").hasArg().argName("port").desc("OpenSearch transport port (default: 9300)").build());
options.addOption(Option.builder("p").longOpt("port").hasArg().argName("port").desc("OpenSearch transport port (default: 9200)").build());
options.addOption(Option.builder("cn").longOpt("clustername").hasArg().argName("clustername").desc("Clustername (do not use together with -icl)").build());
options.addOption( "sniff", "enable-sniffing", false, "Enable client.transport.sniff" );
options.addOption( "icl", "ignore-clustername", false, "Ignore clustername (do not use together with -cn)" );
Expand Down Expand Up @@ -414,9 +414,9 @@ public static int execute(final String[] args) throws Exception {
}


if(port < 9300) {
if(port < 9200) {
System.out.println("WARNING: Seems you want connect to the OpenSearch HTTP port."+System.lineSeparator()
+ " securityadmin connects on the transport port which is normally 9300.");
+ " securityadmin connects on the transport port which is normally 9200.");
}

System.out.print("Will connect to "+hostname+":"+port);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

public class SecurityAdminIEndpointsTests extends SingleClusterTest {

@Test public void testNoSSL() throws Exception {
@Test
public void testNoSSL() throws Exception {
final Settings settings = Settings.builder().put("plugins.security.ssl.http.enabled", false).build();
setup(settings);
final RestHelper rh = nonSslRestHelper();
Expand All @@ -30,7 +31,8 @@ public class SecurityAdminIEndpointsTests extends SingleClusterTest {
Assert.assertEquals(HttpStatus.SC_FORBIDDEN, rh.executeGetRequest("_plugins/_security/whoami").getStatusCode());
}

@Test public void testEndpoints() throws Exception {
@Test
public void testEndpoints() throws Exception {
final Settings settings = Settings.builder().put("plugins.security.ssl.http.enabled", true)
.put("plugins.security.ssl.http.keystore_filepath", FileHelper.getAbsoluteFilePathFromClassPath("node-0-keystore.jks"))
.put("plugins.security.ssl.http.truststore_filepath", FileHelper.getAbsoluteFilePathFromClassPath("truststore.jks"))
Expand Down Expand Up @@ -106,4 +108,4 @@ public class SecurityAdminIEndpointsTests extends SingleClusterTest {

}

}
}

0 comments on commit 95322de

Please sign in to comment.