Skip to content

Commit 3b81a01

Browse files
Update modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java
Co-authored-by: Dianna Hohensee <[email protected]>
1 parent d3836c4 commit 3b81a01

File tree

1 file changed

+2
-1
lines changed
  • modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3

1 file changed

+2
-1
lines changed

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ protected S3ClientBuilder buildClientBuilder(S3ClientSettings clientSettings, Sd
256256
if (Strings.hasLength(clientSettings.endpoint)) {
257257
String endpoint = clientSettings.endpoint;
258258
if ((endpoint.startsWith("http://") || endpoint.startsWith("https://")) == false) {
259-
// Default protocol to https if not specified
259+
// The SDK does not know how to interpret endpoints without a scheme prefix and will error. Therefore, when the scheme is
260+
// absent, we'll supply HTTPS as a default to avoid errors.
260261
// See https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/client-configuration.html#client-config-other-diffs
261262
endpoint = "https://" + endpoint;
262263
LOGGER.info("Defaulting to https for endpoint with no scheme [{}]", clientSettings.endpoint);

0 commit comments

Comments
 (0)