Skip to content

Commit

Permalink
Fix protocol detection from https system property (opensearch-project#61
Browse files Browse the repository at this point in the history
)

Signed-off-by: Andriy Redko <[email protected]>
(cherry picked from commit 2cfae7d)
  • Loading branch information
reta committed Sep 15, 2023
1 parent 196d553 commit 2d75dad
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;

import java.util.Objects;

import javax.net.ssl.SSLContext;

import static org.opensearch.index.codec.customcodecs.CustomCodecService.ZSTD_CODEC;
Expand Down Expand Up @@ -100,7 +102,7 @@ protected void configureHttpOrHttpsClient(RestClientBuilder builder, Settings se

@Override
protected String getProtocol() {
return Strings.isNullOrEmpty(System.getProperty("https")) ? "http" : "https";
return Objects.equals(System.getProperty("https"), "true") ? "https" : "http";
}

/**
Expand Down

0 comments on commit 2d75dad

Please sign in to comment.