[BUG] Align OkHttp and Netty handling of HTTP 407 responses after HTTPS tunnel establishment
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 2.6k
- Fork
- 2.2k
- Merge trung bình
- 2 ngày 34 phút
- Pull request đã merge (30 ngày)
- 244
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/azure-sdk-for-java
-
[Spring Cloud Azure] Improve Javadoc and startup guidance for allowed-group-names vs allowed-group-ids in AadAuthenticationPropertiesCó thể đã có người làm @himanchalkaushale đã nhận 4 ngày trước. Đang mởazure-spring azure-spring-aad Client
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Azure/azure-sdk-for-java#51046 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mgmt, in track 1 migration guide, call out that file-based authentication method is not recommendedCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởAzure.Identity
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
Azure/azure-sdk-for-java#48894 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] IllegalStateException using BlockBlobClient.uploadWithResponse with a stream that blocks during readsCó thể đã có người làm @seanmcc-msft đã nhận hôm nay. Đang mởbug Client customer-reported needs-team-attention Storage
Azure/azure-sdk-for-java#51099 · 2 bình luận · 1 reaction · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Cosmos fallback CharsetDecoder is shared across threads and throws IllegalStateExceptionCó thể đã có người làm @FabianMeiswinkel đã nhận hôm nay. Đang mởClient Cosmos customer-reported needs-team-attention question Service Attention
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Azure/azure-sdk-for-java#51084 · 3 bình luận · 1 reaction · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Search] Adopt TypeSpec-generated SSE APIsCó thể đã có người làm @XiaofeiCao đã nhận 1 ngày trước. Đang mở
Azure/azure-sdk-for-java#51080 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Azure/azure-sdk-for-java
Issue tương tự
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement Java macOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
freerouting/freerouting#1079 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/maven-enforcer#1074 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Gradle liquibaseDiffChangelog drops jhi_date_time_wrapperCó thể đã có người làm @mraible đã nhận hôm nay. Đang mởarea: triage theme: undefined
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
jhipster/generator-jhipster#35998 ·
Maintainer thường phản hồi trong vòng 1 ngày