[BUG] Align OkHttp and Netty handling of HTTP 407 responses after HTTPS tunnel establishment
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Describe the bug
The OkHttp and Netty HTTP transports handle an HTTP 407 response differently when it is returned by an HTTPS endpoint after an HTTP proxy CONNECT tunnel has already been established.
The response is an endpoint response received over the established TLS connection, not a response to the proxy CONNECT request. However, the OkHttp path can invoke proxy-specific handling and issue a follow-up request, while the Netty path treats it as an endpoint response without restarting proxy negotiation.
This issue tracks consistent HTTP response handling when applications switch between transports.
Exception or Stack Trace
Not applicable. This is a response-handling and retry-behavior difference rather than an exception report.
To Reproduce
Use a controlled local test environment:
- Configure an HTTP proxy and an HTTPS test endpoint.
- Allow proxy CONNECT negotiation and TLS establishment to complete normally.
- Have the HTTPS test endpoint return HTTP 407 (
Proxy Authentication Required) over the established TLS connection. - Send the same request using
azure-core-http-okhttpandazure-core-http-nettywith equivalent proxy settings. - Compare the transport-level response handling and whether a proxy-related follow-up is attempted.
The behavior below is based on implementation review; these steps have not been run locally for this tracking issue.
| Transport | Behavior for the endpoint-generated 407 after tunnel establishment |
|---|---|
| OkHttp | OkHttp can invoke the configured proxy authenticator for this response. The SDK authenticator does not distinguish it from a CONNECT-phase response and can produce a proxy-related follow-up request. |
| Netty | Proxy negotiation is handled during CONNECT. Once the tunnel is established, an endpoint-generated 407 does not re-enter the proxy authentication path; it remains an endpoint response for the SDK pipeline/caller to handle. |
Code Snippet
No application snippet is included. The HTTPS test fixture should return status 407 after successful CONNECT and TLS establishment. Use existing proxy test fixtures and compare transport-level behavior independently of service-specific retry policies.
Expected behavior
An endpoint-generated HTTP 407 received inside an established HTTPS tunnel should not restart proxy negotiation. OkHttp and Netty should behave consistently for this scenario.
Acceptance criteria:
- Align OkHttp post-tunnel 407 handling with Netty's connection-phase behavior.
- Preserve normal handling of genuine proxy 407 responses during CONNECT.
- Preserve supported cleartext HTTP proxy behavior.
- Add regression tests for post-tunnel 407 responses, including reuse of an established connection.
- Cover HTTP/1.1 and HTTP/2 endpoint connections where supported.
Screenshots
Not applicable.
Setup (please complete the following information):
- OS: Not OS-specific; implementation review.
- IDE: Not applicable.
- Library/Libraries:
com.azure:azure-core-http-okhttp(reviewed at1.14.0-beta.1, with OkHttp4.12.0) andcom.azure:azure-core-http-nettyfor behavior comparison. - Java version: No local runtime reproduction performed for this tracking issue.
- App Server/Environment: Java application using an Azure SDK HTTP transport through an HTTP proxy to a controlled HTTPS endpoint.
- Frameworks: None required.
A dependency version mismatch is not suspected. Dependency-tree output and exception logs are not applicable to this tracking issue.
Additional context
Review the OkHttp ProxyAuthenticator and its builder integration against the Netty proxy handling lifecycle. The goal is transport parity and predictable response handling, not a public API change. Keep the change focused on distinguishing CONNECT-phase responses from endpoint responses and adding related regression coverage.
Information Checklist
- Bug Description Added
- Repro Steps Added (controlled test scenario provided; not executed locally)
- Setup information Added
- 主要言語
- Java
- スター
- 2.6k
- フォーク
- 2.2k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 213
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/azure-sdk-for-java のほかの issue
-
mgmt, in track 1 migration guide, call out that file-based authentication method is not recommended再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンAzure.Identity
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
Azure/azure-sdk-for-java#48894 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] - Handler.close livelocks on FAIL_NON_SERIALIZED while holding the ReactorConnection monitor対応中かも @conniey が 1 日前に担当しました。 オープンAzure.Core.AMQP Client customer-reported needs-team-attention question
Azure/azure-sdk-for-java#50879 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Design] Support External Evaluation Policy (Invoke) in management SDKs対応中かも @weidongxu-microsoft が 6 日前に担当しました。 オープン
Azure/azure-sdk-for-java#50818 · リアクション 2 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] azure-core-http-vertx: Streaming request bodies hang on Vert.x 5.x (NoSuchMethodError on HttpClientRequest.reset)対応中かも @alzimmermsft が 6 日前に担当しました。 オープンAzure.Core Client customer-reported needs-team-attention question
Azure/azure-sdk-for-java#50793 · コメント 6 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[FEATURE REQ] ChangeFeedProcessor event handler fully reactive implementation対応中かも @FabianMeiswinkel が 7 日前に担当しました。 オープンClient Cosmos customer-reported feature-request needs-team-attention Service Attention
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
Azure/azure-sdk-for-java#50758 · コメント 3 件 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
Azure/azure-sdk-for-java の issue をすべて見る
似ている issue
-
area: android good first issue help wanted testing
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Gautam-aman/ResQNet#56 ·
メンテナーはふだん 1 日以内に返信
-
documentation hermes-queue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
chrisalunlloyd2-sudo/mindpalace#294 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
QuicksilverMC/Argentum#31 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
saysky/ForestBlog#111 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
eclipse-hawkbit/hawkbit#3429 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信