Skip to content

Commit 7e666e0

Browse files
Corrects the security config constant name which uses trusted cas
Signed-off-by: Darshit Chanpura <[email protected]>
1 parent bae1bee commit 7e666e0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/main/java/org/opensearch/commons/ConfigConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ConfigConstants {
2121
public static final String AUTHORIZATION = "Authorization";
2222

2323
// These reside in security plugin.
24-
public static final String OPENSEARCH_SECURITY_SSL_HTTP_PEMCERT_FILEPATH = "plugins.security.ssl.http.pemcert_filepath";
24+
public static final String OPENSEARCH_SECURITY_SSL_HTTP_PEMTRUSTEDCAS_FILEPATH = "plugins.security.ssl.http.pemtrustedcas_filepath";
2525
public static final String OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_FILEPATH = "plugins.security.ssl.http.keystore_filepath";
2626
/**
2727
* @deprecated in favor of the {@link #OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_PASSWORD_SETTING} secure setting

src/main/java/org/opensearch/commons/rest/SecureRestClientBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ private String resolve(final String originalFile, final Path configPath) {
310310
}
311311

312312
private String getTrustPem() {
313-
return settings.get(ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_PEMCERT_FILEPATH, null);
313+
return settings.get(ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_PEMTRUSTEDCAS_FILEPATH, null);
314314
}
315315

316316
private String getKeystorePasswd() {

src/test/java/org/opensearch/commons/rest/IntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import static org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_FILEPATH;
1212
import static org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_KEYPASSWORD_SETTING;
1313
import static org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_PASSWORD_SETTING;
14-
import static org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_PEMCERT_FILEPATH;
14+
import static org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_SSL_HTTP_PEMTRUSTEDCAS_FILEPATH;
1515

1616
import java.io.File;
1717
import java.nio.file.Path;
@@ -63,7 +63,7 @@ public void testCreateRestClientWithCerts() throws Exception {
6363
.builder()
6464
.put("http.port", 9200)
6565
.put(OPENSEARCH_SECURITY_SSL_HTTP_ENABLED, true)
66-
.put(OPENSEARCH_SECURITY_SSL_HTTP_PEMCERT_FILEPATH, "sample.pem")
66+
.put(OPENSEARCH_SECURITY_SSL_HTTP_PEMTRUSTEDCAS_FILEPATH, "sample.pem")
6767
.put(OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_FILEPATH, "test-kirk.jks")
6868
.setSecureSettings(createSecureSettings())
6969
.build();

src/test/java/org/opensearch/commons/rest/SecureRestClientBuilderTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void testMissingConfigPath() {
6060
.builder()
6161
.put("http.port", 9200)
6262
.put("plugins.security.ssl.http.enabled", true)
63-
.put("plugins.security.ssl.http.pemcert_filepath", "sample.pem")
63+
.put("plugins.security.ssl.http.pemtrustedcas_filepath", "sample.pem")
6464
.build();
6565
new SecureRestClientBuilder(settings, Paths.get("sample.pem")).build();
6666
});

0 commit comments

Comments
 (0)