Skip to content

Enforce proxy in UrlConnectionHttpClient #2650

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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

RodargDev
Copy link

This PR should resolve this issue where the proxy currently isn't enforced #2297

The code is currently untested, im using it as a reference to see if you guys would accept a solution like this if it were to be tested.

@Copilot Copilot AI review requested due to automatic review settings May 26, 2025 09:11
@RodargDev RodargDev requested a review from a team as a code owner May 26, 2025 09:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a proxy enforcement mechanism in the UrlConnectionHttpClient for HTTP requests by selecting a proxy via the system ProxySelector and falling back to system properties if necessary.

  • Enforces the use of a proxy when creating HttpURLConnection.
  • Adds an overloaded method in HttpUrlConnectionFactory to support proxy parameters.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
common4j/src/main/com/microsoft/identity/common/java/net/UrlConnectionHttpClient.java Introduces proxy selection logic and updates connection creation.
common4j/src/main/com/microsoft/identity/common/java/net/HttpUrlConnectionFactory.java Adds an overload to create a HttpURLConnection with a specified proxy.

@RodargDev RodargDev marked this pull request as draft May 26, 2025 09:41
@RodargDev
Copy link
Author

@RodargDev please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree

@RodargDev RodargDev marked this pull request as ready for review May 26, 2025 14:04
@RodargDev
Copy link
Author

RodargDev commented Jun 2, 2025

@nilo-ms or @p3dr0rv any chance you or anyone from your team can have a look at this because currently I don't really know what I can do to get this looked at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant