Skip to content

Replace URL.openConnection() with standard Java HttpClient to support Http proxies#207

Open
renaudberube wants to merge 6 commits into
gradle:mainfrom
renaudberube:proxy
Open

Replace URL.openConnection() with standard Java HttpClient to support Http proxies#207
renaudberube wants to merge 6 commits into
gradle:mainfrom
renaudberube:proxy

Conversation

@renaudberube

@renaudberube renaudberube commented Jul 17, 2026

Copy link
Copy Markdown

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 11 HttpClient in 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.

@github-actions github-actions Bot added from:contributor PR by an external contributor to-triage labels Jul 17, 2026
@renaudberube
renaudberube marked this pull request as ready for review July 17, 2026 04:47
@ghale

ghale commented Jul 20, 2026

Copy link
Copy Markdown
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.

@ghale ghale added enhancement New feature or request 👋 team-triage Issues that need to be triaged by a specific team and removed to-triage labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request from:contributor PR by an external contributor 👋 team-triage Issues that need to be triaged by a specific team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants