Skip to content
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

Proxy authentication not working #237

Closed
william00179 opened this issue Mar 18, 2024 · 1 comment
Closed

Proxy authentication not working #237

william00179 opened this issue Mar 18, 2024 · 1 comment
Labels

Comments

@william00179
Copy link

william00179 commented Mar 18, 2024

Describe the bug

Configuring Unleash to use a proxy with authentication.

Unauthenticated proxy works well, but when you configure Unleash with credentials, the CustomProxyAuthenticator is created as expected in the configuration builder, but the getPasswordAuthentication method is never called and the requests to the proxy server fail with HTTP/1.1 407 Proxy Authentication Required

Steps to reproduce the bug

  1. Configure unleash with an authenticated HTTP proxy.
  2. Run unleash.

Expected behavior

Unleash should provide the expected authentication

Logs, error output, etc.

Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
gateway-qa-1  |         at java.base/sun.net.www.protocol.http.HttpURLConnection.doTunneling0(HttpURLConnection.java:2271) ~[na:na]
gateway-qa-1  |         at java.base/sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2143) ~[na:na]
gateway-qa-1  |         at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[na:na]
gateway-qa-1  |         at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:141) ~[na:na]
gateway-qa-1  |         at io.getunleash.repository.HttpFeatureFetcher.fetchFeatures(HttpFeatureFetcher.java:36) ~[unleash-client-java-9.2.0.jar!/:9.2.0]
gateway-qa-1  |         ... 52 common frames omitted

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

None

Hosting type

None

SDK information (language and version)

9.2.0

@william00179
Copy link
Author

It looks like this is an issue with the default fetcher if not using OkHttp.

Java 8 removed the ability to use authenticated proxies with HttpURLConnection and HTTPS requests by default.

I will use my own feature fetcher with an HTTP client that supports the authenticated proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant