Replace URL.openConnection() with standard Java HttpClient to support Http proxies#207
Open
renaudberube wants to merge 6 commits into
Open
Replace URL.openConnection() with standard Java HttpClient to support Http proxies#207renaudberube wants to merge 6 commits into
renaudberube wants to merge 6 commits into
Conversation
added 2 commits
July 16, 2026 23:56
renaudberube
marked this pull request as ready for review
July 17, 2026 04:47
Member
|
Thank you for your proposed contribution! This PR has a valid DCO and tests. The relevant team for this area will confirm the implementation choices. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
My workplace runs builds on GitLab runners that are configured to use a corporate proxy to access the Internet. It is not always ideal to have to align the Java version of the builder docker image with the project required toolchain and the current way this plugin is accessing the Internet does not support Http proxy.
This PR replaces the low level
URL.openConnection()with the standard Java 11HttpClientin order to transparently support Http proxies configured on host. By default the HttpClient uses ProxySelector.getDefault() to get the system-wide proxy selector. The HttpClient will pick up proxy configurations defined as environment variables or configurations passed directly to the Gradle daemon.`Added a functional tests to make sure the plugin can work with a proxy. All other tests are passing.
I am sorry, I did not open an issue beforehand as I saw that contributions were welcome by looking at other issues.