Skip to content

Commit 61d312d

Browse files
committed
set local domain name to localhost.localstack.cloud to match certificate
1 parent 1b8ccde commit 61d312d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/main/java/cloud/localstack/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
public class Constants {
77
public static final Map<String, Integer> DEFAULT_PORTS = new HashMap<>();
88

9+
public static final String LOCALHOST_DOMAIN_NAME = "localhost.localstack.cloud";
10+
911
static {
1012
DEFAULT_PORTS.put("apigateway", 4567);
1113
DEFAULT_PORTS.put("kinesis", 4568);

src/main/java/cloud/localstack/Localstack.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cloud.localstack;
22

3+
import cloud.localstack.Constants;
34
import cloud.localstack.ServiceName;
45
import cloud.localstack.docker.*;
56
import cloud.localstack.docker.command.*;
@@ -110,12 +111,12 @@ private void loadServiceToPortMap() {
110111
public String getEndpointS3() {
111112
String s3Endpoint = endpointForService(ServiceName.S3);
112113
/*
113-
* Use the domain name wildcard *.localhost.atlassian.io which maps to 127.0.0.1
114+
* Use the domain name wildcard *.localhost.localstack.cloud which maps to 127.0.0.1
114115
* We need to do this because S3 SDKs attempt to access a domain <bucket-name>.<service-host-name>
115116
* which by default would result in <bucket-name>.localhost, but that name cannot be resolved
116117
* (unless hardcoded in /etc/hosts)
117118
*/
118-
s3Endpoint = s3Endpoint.replace("localhost", "test.localhost.atlassian.io");
119+
s3Endpoint = s3Endpoint.replace("localhost", Constants.LOCALHOST_DOMAIN_NAME);
119120
return s3Endpoint;
120121
}
121122

src/main/java/cloud/localstack/deprecated/Localstack.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ public static String getEndpointS3() {
125125
public static String getEndpointS3(boolean overrideSSL) {
126126
String s3Endpoint = ensureInstallationAndGetEndpoint(ServiceName.S3, overrideSSL);
127127
/*
128-
* Use the domain name wildcard *.localhost.atlassian.io which maps to 127.0.0.1
128+
* Use the domain name wildcard *.localhost.localstack.cloud which maps to 127.0.0.1
129129
* We need to do this because S3 SDKs attempt to access a domain <bucket-name>.<service-host-name>
130130
* which by default would result in <bucket-name>.localhost, but that name cannot be resolved
131131
* (unless hardcoded in /etc/hosts)
132132
*/
133-
s3Endpoint = s3Endpoint.replace("localhost", "test.localhost.atlassian.io");
133+
s3Endpoint = s3Endpoint.replace("localhost", Constants.LOCALHOST_DOMAIN_NAME);
134134
return s3Endpoint;
135135
}
136136

0 commit comments

Comments
 (0)