Skip to content

Force disable proxy when communicating with Lambda runtime API. - #2578

Merged
normj merged 1 commit into
masterfrom
normj/no-proxy
Sep 17, 2026
Merged

normj merged 1 commit into
masterfrom
normj/no-proxy

Conversation

@normj

@normj normj commented Sep 17, 2026

Copy link
Copy Markdown
Member

Description of changes:

The HttpClient that Amazon.Lambda.RuntimeSupport uses to communicate with the Lambda Runtime API (RAPID) now forces proxy usage off. Its underlying SocketsHttpHandler is created with UseProxy = false.

Problem: SocketsHttpHandler honors HttpClient.DefaultProxy, which is populated from the HTTP_PROXY/HTTPS_PROXY environment variables. When a customer configures a proxy, internal Runtime API calls were being routed through it. That fails because the RAPID endpoint is not necessarily on a loopback address (only localhost is implicitly exempt in most proxy implementations), so the runtime could not talk to the Runtime API.

Fix: Disable the proxy on the Runtime API handler only. This is scoped to the HttpClient used for Runtime API communication and has no impact on HTTP calls made from customer handler code.

This mirrors the equivalent fix made in the Java Lambda runtime client.

Testing:

  • Added RuntimeApiHttpClientBypassesProxy unit test asserting the Runtime API handler has UseProxy == false.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@normj
normj requested review from a team as code owners September 17, 2026 16:40
@normj
normj requested review from GarrettBeatty and a lite review from Copilot September 17, 2026 16:40

@ashishdhingra ashishdhingra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation is correctly scoped and covered by an appropriate unit test.

Pull request overview

Disables proxy usage for the Runtime API HTTP client so customer proxy environment variables cannot interfere with Lambda runtime communication.

Changes:

  • Sets SocketsHttpHandler.UseProxy = false.
  • Adds a unit test verifying proxy bypass behavior.
  • Adds a patch changelog entry.
File summaries
File Description
LambdaBootstrap.cs Disables proxy use for Runtime API requests.
LambdaBootstrapTests.cs Verifies the handler bypasses proxies.
.autover/changes/...json Documents the patch release change.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@normj
normj merged commit af556b1 into master Sep 17, 2026
9 checks passed
@normj
normj deleted the normj/no-proxy branch September 17, 2026 21:35
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.

5 participants