Skip to content

Commit 4385fb6

Browse files
committed
Updated change logs
1 parent 541a497 commit 4385fb6

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "bugfix",
3+
"category": "AWS CRT HTTP Client",
4+
"contributor": "",
5+
"description": "Addressing Issue [#4745](https://github.com/aws/aws-sdk-java-v2/issues/4745) , Netty and CRT clients' default proxy settings have been made consistent with the Apache client, now using environment and system property settings by default.\\n To disable the use of environment variables and system properties by default, set useSystemPropertyValue(false) and useEnvironmentVariablesValues(false) in ProxyConfigurations."
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "bugfix",
3+
"category": "Netty NIO Async HTTP Client",
4+
"contributor": "",
5+
"description": "Addressing Issue [#4745](https://github.com/aws/aws-sdk-java-v2/issues/4745) , Netty and CRT clients' default proxy settings have been made consistent with the Apache client, now using environment and system property settings by default.\\n To disable the use of environment variables and system properties by default, set useSystemPropertyValue(false) and useEnvironmentVariablesValues(false) in ProxyConfigurations"
6+
}

test/http-client-tests/src/main/java/software/amazon/awssdk/http/proxy/HttpClientDefaultProxyConfigTestSuite.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,18 @@
5959
import software.amazon.awssdk.utils.Pair;
6060

6161
public abstract class HttpClientDefaultProxyConfigTestSuite {
62-
SecureRandom random = new SecureRandom();
62+
6363
private static final EnvironmentVariableHelper ENVIRONMENT_VARIABLE_HELPER = new EnvironmentVariableHelper();
64-
protected WireMockServer mockProxy = new WireMockServer(new WireMockConfiguration()
65-
.dynamicPort()
66-
.dynamicHttpsPort()
67-
.enableBrowserProxying(true));
6864

69-
protected WireMockServer mockServer = new WireMockServer(new WireMockConfiguration()
70-
.dynamicPort()
71-
.dynamicHttpsPort());
65+
SecureRandom random = new SecureRandom();
66+
WireMockServer mockProxy = new WireMockServer(new WireMockConfiguration()
67+
.dynamicPort()
68+
.dynamicHttpsPort()
69+
.enableBrowserProxying(true));
70+
71+
WireMockServer mockServer = new WireMockServer(new WireMockConfiguration()
72+
.dynamicPort()
73+
.dynamicHttpsPort());
7274

7375
protected abstract boolean isSyncClient();
7476

@@ -104,19 +106,19 @@ public static Stream<Arguments> proxyConfigurationSettingsForEnvironmentAndSyste
104106
Arguments.of(new TestData()
105107
.addSystemProperKeyValue("http.proxyHost", "localhost")
106108
.addSystemProperKeyValue("http.proxyPort", "%s")
107-
.addEnvironmentPropertyProperKeyValue("https_proxy", "http://" + "localhost" + ":" + "%s" + "/")
108-
, "Provided system and environment variable when configured uses proxy config"),
109+
.addEnvironmentPropertyProperKeyValue("https_proxy", "http://" + "localhost" + ":" + "%s" + "/"),
110+
"Provided system and environment variable when configured uses proxy config"),
109111

110112
Arguments.of(new TestData()
111113
.addSystemProperKeyValue("http.proxyHost", "localhost")
112114
.addSystemProperKeyValue("http.proxyPort", "%s")
113-
.addEnvironmentPropertyProperKeyValue("none", "none")
114-
, "Provided system and No environment variables uses proxy config"),
115+
.addEnvironmentPropertyProperKeyValue("none", "none"),
116+
"Provided system and No environment variables uses proxy config"),
115117

116118
Arguments.of(new TestData()
117119
.addSystemProperKeyValue("none", "none")
118-
.addEnvironmentPropertyProperKeyValue("http_proxy", "http://" + "localhost" + ":" + "%s" + "/")
119-
, "Provided Environment Variables and No system variables uses proxy config")
120+
.addEnvironmentPropertyProperKeyValue("http_proxy", "http://" + "localhost" + ":" + "%s" + "/"),
121+
"Provided Environment Variables and No system variables uses proxy config")
120122
);
121123
}
122124

@@ -140,13 +142,15 @@ private void setSystemPropertyAndEnvironmentVariablesToDivertToHttpsProxy(TestDa
140142
testData.systemPropertyPair.stream()
141143
.map(r -> isSyncClient() ? r : Pair.of(r.left().replace("http", "https"),
142144
r.right().replace("http", "https")))
143-
.forEach(settingsPair -> System.setProperty(settingsPair.left(), String.format(settingsPair.right(), port)));
145+
.forEach(settingsPair -> System.setProperty(settingsPair.left(),
146+
String.format(settingsPair.right(), port)));
144147

145148
testData.envSystemSetting.stream()
146149
.map(r -> isSyncClient() ? r : Pair.of(r.left().replace("http", "https"),
147150
r.right().replace("http", "https")))
148151
.forEach(settingsPair -> ENVIRONMENT_VARIABLE_HELPER.set(settingsPair.left(),
149-
String.format(settingsPair.right(), port)));
152+
String.format(settingsPair.right(),
153+
port)));
150154
}
151155

152156
private void setSystemPropertyAndEnvironmentVariables(TestData testData, int port) {

0 commit comments

Comments
 (0)