-
Notifications
You must be signed in to change notification settings - Fork 914
Add ProxyConfiguration support for UrlConnectionHttpClient #3112
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
Conversation
cfa933a
to
f0073e6
Compare
f0073e6
to
7034585
Compare
@@ -0,0 +1,6 @@ | |||
{ | |||
"category": "UrlConnectionHttpClient", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "URLConnection HTTP Client"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
new InetSocketAddress(this.proxyConfiguration.host(), this.proxyConfiguration.port()))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this resolves the address at construction time, which is not what we want. We should use InetSocketAddress.createUnresolved()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
import software.amazon.awssdk.http.SdkHttpRequest; | ||
import software.amazon.awssdk.utils.AttributeMap; | ||
|
||
public class UrlConnectionHttpClientWithProxyTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: for the test method name, can you include the expected outcome? It makes tests easier to read and reason about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
61047a8
to
746c30e
Compare
.changes/next-release/feature-UrlConnectionHttpClient-f600f1e.json
Outdated
Show resolved
Hide resolved
SonarCloud Quality Gate failed. |
Motivation and Context
Raised a new request for #2986
Resolves #2458. The goal of this change is to add full proxy support to the UrlConnectionHttpClient so that our project can remove the Apache HTTP Client and instead rely on Java builtins. This change must support HTTP and HTTPS proxies with username/password authorization.
Modifications
Adds HTTP proxy support to the UrlConnectionHttpClient by using largely the same
ProxyConfiguration
class as is in the Apache HTTP Client. If the user configures a proxy using the builder, and the request isn't going to a non-proxy host, then the request will go through the application proxy using Java's builtinProxy
class.Testing
Manually tested using a local squid proxy via HTTP without authentication.
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License
Misc