Skip to content

Commit

Permalink
Fix protocol detection from https system property (#61) (#64)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 2cfae7d)
  • Loading branch information
reta authored Sep 15, 2023
1 parent 28cea11 commit c753a50
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 c753a50

Please sign in to comment.