-
Notifications
You must be signed in to change notification settings - Fork 887
Fixed proxy Issue #5225
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
base: master
Are you sure you want to change the base?
Fixed proxy Issue #5225
Conversation
…-agent into users/raunakjaiswalMS/fixingProxyIssue
…-agent into users/raunakjaiswalMS/fixingProxyIssue
…-agent into users/raunakjaiswalMS/fixingProxyIssue # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
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.
Pull Request Overview
This PR addresses a socket timeout error when publishing test run data from behind a corporate proxy by ensuring the default .NET HttpClient is configured with the correct proxy settings.
- Sets the global HttpClient proxy settings in both the Worker and Listener processes.
- Introduces a new ProxyUtil class to centralize proxy configuration for all new HttpClientHandler instances.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Agent.Worker/Worker.cs | Configures the default HttpClient proxy before initializing the VSS client settings. |
src/Agent.Sdk/Util/ProxyUtil.cs | Defines a utility to set HttpClient.DefaultProxy for global proxy configuration. |
src/Agent.Listener/Agent.cs | Ensures the Listener process also applies the default proxy configuration before client initialization. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Context
Issue: Publishing test run data from behind corporate proxy fails with socket timeout error while accessing ufxtcmprodweu21.vstmrblob.vsassets.io:443
Work item link
Icm link
Description
Customers have set-up agent locally behind corporate proxy where they failed to publish test run data and get the below error.
Why it happened?
We are setting the proxy in VSSUtil that helps configure VSS (Azure DevOps) client settings, but it does not globally enforce proxy settings for all HTTP clients in the process.
WebApi (and other SDKs) often create their own HttpClient or connection objects, which may not automatically pick up the proxy settings from VssUtil unless explicitly configured.

Example:
How is Issue reproduced locally?
We have attempted to recreate by doing the following.
Setup up a self-hosted Agent behind a proxy Doc
Configure a local proxy using Fiddler.
Restrict all outbound traffic to the
Agent.Listener
and theAgent.Worker
processes.Agent.Listener
and theAgent.Worker
processes to only access the Local Proxy (127.0.0.1)Configure a test pipeline to use the same vso command as used by the customer to publish a sample TRX file.
By default, Fiddler on starting, sets proxy for entire process running in the system. So, we need to disable it by manipulating.
Solution:
Risk Assessment (Low / Medium / High)
Medium
Unit Tests Added or Updated (Yes / No)
Indicate whether unit tests were added or modified to reflect the changes.
Added test case in canary repo PR:
https://github.com/microsoft/azure-pipelines-canary/pull/1196
Currently Test case is failing with latest agent Version:
Failure Pipeline Link
Test Case is getting passed when taking Agent from this branch users/raunakjaiswalMS/fixingProxyIssue
Passed Pipeline Link
Additional Testing Performed
List manual or automated tests performed beyond unit tests (e.g., integration, scenario, regression).
Reproducing the issue by locally following above steps: ❌
When default proxy is set to httpClient in worker process only: ✅
When default proxy is set to httpClient in Listener process only: ❌