-
Notifications
You must be signed in to change notification settings - Fork 915
Http Client made consistent with Default Proxy Configurations #4957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
296dbc1
Http Client made consistent with Default Proxy Configurations
joviegas 4d2e472
made changes for URL client
joviegas 23e9db4
Updated test case Name
joviegas cdf1750
Updated comments related to test cases
joviegas 541a497
Merge branch 'master' into joviegas/proxy_config_consistent
joviegas 4385fb6
Updated change logs
joviegas 6ab357a
Merge branch 'master' into joviegas/proxy_config_consistent
joviegas b321a78
Updated test case to clear all System properties
joviegas 626e49d
Merge branch 'master' into joviegas/proxy_config_consistent
joviegas f64ecc1
Non Proxy configs should be independently picked up irrespective of P…
joviegas aac09a7
Revert "Non Proxy configs should be independently picked up irrespect…
joviegas 951ae74
Handled Zoes comments to close the client
joviegas e798edb
Merge branch 'master' into joviegas/proxy_config_consistent
joviegas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "bugfix", | ||
"category": "AWS CRT HTTP Client", | ||
"contributor": "", | ||
"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." | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "bugfix", | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"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 changes: 6 additions & 0 deletions
6
.changes/next-release/bugfix-NettyNIOAsyncHTTPClient-edd86be.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "bugfix", | ||
"category": "Netty NIO Async HTTP Client", | ||
"contributor": "", | ||
"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" | ||
} |
52 changes: 52 additions & 0 deletions
52
.../src/test/java/software/amazon/awssdk/http/apache/ApacheClientProxyConfigurationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.http.apache; | ||
|
||
import org.apache.http.conn.HttpHostConnectException; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
import software.amazon.awssdk.http.async.SdkAsyncHttpClient; | ||
import software.amazon.awssdk.http.proxy.HttpClientDefaultProxyConfigTestSuite; | ||
import java.net.ConnectException; | ||
|
||
public class ApacheClientProxyConfigurationTest extends HttpClientDefaultProxyConfigTestSuite { | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedExceptionType() { | ||
return HttpHostConnectException.class; | ||
|
||
} | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedCauseExceptionType() { | ||
return ConnectException.class; | ||
} | ||
|
||
@Override | ||
protected boolean isSyncClient() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected SdkAsyncHttpClient createHttpClientWithDefaultProxy() { | ||
throw new IllegalArgumentException("Async client is not supported for this test."); | ||
} | ||
|
||
@Override | ||
protected SdkHttpClient createSyncHttpClientWithDefaultProxy() { | ||
return ApacheHttpClient.create(); | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...t/src/test/java/software/amazon/awssdk/http/crt/AsyncCrtClientProxyConfigurationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.http.crt; | ||
|
||
import java.io.IOException; | ||
import java.util.concurrent.ExecutionException; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
import software.amazon.awssdk.http.async.SdkAsyncHttpClient; | ||
import software.amazon.awssdk.http.proxy.HttpClientDefaultProxyConfigTestSuite; | ||
|
||
public class AsyncCrtClientProxyConfigurationTest extends HttpClientDefaultProxyConfigTestSuite { | ||
@Override | ||
protected Class<? extends Exception> getProxyFailedExceptionType() { | ||
return ExecutionException.class; | ||
} | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedCauseExceptionType() { | ||
return IOException.class; | ||
} | ||
|
||
@Override | ||
protected boolean isSyncClient() { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected SdkAsyncHttpClient createHttpClientWithDefaultProxy() { | ||
return AwsCrtAsyncHttpClient.create(); | ||
} | ||
|
||
@Override | ||
protected SdkHttpClient createSyncHttpClientWithDefaultProxy() { | ||
throw new IllegalArgumentException("Sync client is not supported for this test."); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...nt/src/test/java/software/amazon/awssdk/http/crt/SyncCrtClientProxyConfigurationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.http.crt; | ||
|
||
import java.io.IOException; | ||
import software.amazon.awssdk.crt.http.HttpException; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
import software.amazon.awssdk.http.async.SdkAsyncHttpClient; | ||
import software.amazon.awssdk.http.proxy.HttpClientDefaultProxyConfigTestSuite; | ||
|
||
public class SyncCrtClientProxyConfigurationTest extends HttpClientDefaultProxyConfigTestSuite { | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedExceptionType() { | ||
return IOException.class; | ||
} | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedCauseExceptionType() { | ||
return HttpException.class; | ||
} | ||
|
||
@Override | ||
protected boolean isSyncClient() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected SdkAsyncHttpClient createHttpClientWithDefaultProxy() { | ||
throw new UnsupportedOperationException("Async client is not supported for this test."); | ||
} | ||
|
||
@Override | ||
protected SdkHttpClient createSyncHttpClientWithDefaultProxy() { | ||
return AwsCrtHttpClient.create(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
http-clients/netty-nio-client/src/test/java/NettyClientProxyConfigurationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
import java.net.ConnectException; | ||
import java.util.concurrent.ExecutionException; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
import software.amazon.awssdk.http.async.SdkAsyncHttpClient; | ||
import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient; | ||
import software.amazon.awssdk.http.proxy.HttpClientDefaultProxyConfigTestSuite; | ||
|
||
public class NettyClientProxyConfigurationTest extends HttpClientDefaultProxyConfigTestSuite { | ||
@Override | ||
protected boolean isSyncClient() { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected SdkAsyncHttpClient createHttpClientWithDefaultProxy() { | ||
return NettyNioAsyncHttpClient.create(); | ||
} | ||
|
||
@Override | ||
protected SdkHttpClient createSyncHttpClientWithDefaultProxy() { | ||
throw new IllegalArgumentException("Sync client is not supported for this test."); | ||
} | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedExceptionType() { | ||
return ExecutionException.class; | ||
} | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedCauseExceptionType() { | ||
return ConnectException.class; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
.../test/java/software/amazon/awssdk/http/urlconnection/UrlClientProxyConfigurationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.http.urlconnection; | ||
|
||
import java.io.IOException; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
import software.amazon.awssdk.http.async.SdkAsyncHttpClient; | ||
import software.amazon.awssdk.http.proxy.HttpClientDefaultProxyConfigTestSuite; | ||
|
||
public class UrlClientProxyConfigurationTest extends HttpClientDefaultProxyConfigTestSuite { | ||
@Override | ||
protected boolean isSyncClient() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected SdkAsyncHttpClient createHttpClientWithDefaultProxy() { | ||
throw new UnsupportedOperationException("Async client is not supported for this test."); | ||
} | ||
|
||
@Override | ||
protected SdkHttpClient createSyncHttpClientWithDefaultProxy() { | ||
return UrlConnectionHttpClient.create(); | ||
} | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedExceptionType() { | ||
return IOException.class; | ||
} | ||
|
||
@Override | ||
protected Class<? extends Exception> getProxyFailedCauseExceptionType() { | ||
return null; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.