-
Notifications
You must be signed in to change notification settings - Fork 596
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
Proxies with basic authorization do not work in Unirest 4 #535
Comments
Hi @KostyantynFT thanks for posting this. Can I asked if you can try the following. Before you make the request, set the following properties with your values:
|
Yes, it works. But I do not think we can use this approach. We have a big web-app and we call many different web-services and only for one of them we need to use a proxy (I spawn a Unirest instance for that). At the moment I just added Unirest 3.14.1 to the pom, so we have both dependencies (3 and 4) and for these calls via proxy I use the old classes from kong.unirest.* packages. I think it should work this way. |
Unfortunately this seems to be a limitation with Java itself |
I think it would be useful to be able to select which client to use on creating/spawning Unirest - Java or Apache. |
Apache 4 does not support all the new features we need like HTTP2, and Websockets. Apache 5's async model is fully reactive and is incompatible with the way Unrest wants to do async, so it has never been able to "fit" as an engine. |
Proxies with basic authorization do not work in Unirest 4 but works fine in 3.14.1.
It looks like the native Java client does not work correctly.
I setup a squid server with basic authorization.
Requests via Postman or Insomnia works fine.
But credentials are not provided when working via Unirest 4.4.4.
So the proxy server returns the 407 error.
Here is the squid log. The first entry - a request with Unirest 3.14.1 - the user name is provided (ftproxy).
The second entry - a request with Unirest 4.4.4 - the user name is empty and the request is denied.
Code:
Log:
The text was updated successfully, but these errors were encountered: