Fix OpenAI webproxy auth with Apache HttpClient 5 - #1070
Open
ehoogerbeets wants to merge 7 commits into
Open
Conversation
Closed
This was referenced Jul 30, 2026
- We were attempting to use the Basic tunneling scheme to talk to webproxy, but the JDK turns it off by default, so queries through our webproxy server were silently hanging
Introduce l10n.webproxy settings with per-service overrides for backward compatibility, an opt-in for Basic auth on HTTPS CONNECT, and a default connect timeout so unreachable proxies fail quickly instead of hanging. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- based on review comments from Wadim
- This is an existing library that is already used in other parts of mojito
- It has no problems with authentication negotiation and a Authentication Bearer header
- Added OpenAIClientIntegrationTest which only runs when your
company's OpenAI is configured in the properties files
- Full, complete round trip simplistic query to ChatGPT as a smoke
test to verify that everything connects properly before you go
and test with a real server
- Can test the webproxy support too
- if your proxy server says it supports "Digest" but in reality, it doesn't, or if you have some sort of other auth scheme that is not already in the default list, you can now change the schemes list with a new setting in the application.properties
ehoogerbeets
force-pushed
the
fixProxyBearerToken2
branch
from
July 30, 2026 16:57
cb289ce to
3a2804a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
java.net.http.HttpClientto Apache HttpClient 5 (already used elsewhere in Mojito) so proxy auth negotiation and the OpenAIAuthorization: Bearerheader work correctly (avoids JDK-8326949 / silent hangs through webproxy).proxy-preferred-auth-schemesconfiguration so deployments can override HttpClient’s default auth scheme preference when a proxy advertises schemes it does not actually support (e.g. Digest before Basic).OpenAIClientIntegrationTest(opt-in via configured OpenAI properties) as a smoke test for end-to-end ChatGPT connectivity, including webproxy support.Context
Follow-up to #1069 (
fixProxyBearerToken), incorporating review feedback and the preferred-auth-schemes enhancement on branchfixProxyBearerToken2.Test plan
OpenAIHttpClientFactory,OpenAIClient, and AI translate/review config property wiringOpenAIClientIntegrationTestand confirm a successful ChatGPT round trip through the proxyproxy-preferred-auth-schemes) still works with HttpClient defaultsBasic,Digest), confirm preferred schemes are applied on the request config and CONNECT succeeds against a Digest-advertising proxy that only works with BasicMade with Cursor