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
UnknownHostException when behind a proxy #479
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/119193483 The labels on this github issue will be updated when the story is started. |
@michahirsch We've never really had full proxy support and lucked out with the support that Spring's |
This change adds support for proxies in the Reactor Netty implementation. Proxies are configured along with the rest of the connection information and added to the root HttpClient that all implementations use. In addition, the SslCertificateTruster was updated to use the proxy when connecting to download SSL certificates for trusting. [#479]
@michahirsch I've added support for proxies to the Reactor side of the implementation. Configuration can be done as shown in our integration tests. Note that despite what it appears, this will not configure the Spring bit of the implementation and you'll have to set both sets of configuration parameters until the Spring implementation is completely removed. Let me know how the latest snapshot works for you. |
@nebhale thanks for the quick reply. Yes with the Java won't be able to resolve the hostname, this needs to be done by the proxy which e.g. the |
Right, I'm surprised that it's resolving the host name at all. The addition of the Netty |
I just wanted to give you a heads up that we're waiting on a change to Reactor Netty that will give you the functionality that you need. Should arrive in the next couple of days. At that point, the hybrid version of proxy configuration should work properly for you. After that it'll just be us remove the rest of the Spring networking stuff and then you'll be down to the single configuration. |
@nebhale thanks for the update, sounds great, I looking forward to try it out then :) |
Hello @nebhale . Do you have any update about this issue ? |
@s-bortolussi we are updating some internals in reactor to support it and hopefully come to a resolution later this week that will sync with the CF java client team. I don't think the client opens the low level config of the client yet to the user for now so it will be hard until you get our own workaround. |
@smaldini thanks for the quick reply. Looking forward to getting your workaround. |
@s-bortolussi I'm back at work after a holiday, and I'll make sure that I have a crack at this as soon as I can. |
@s-bortolussi did you find a workaround ? I am assuming 516 is same issue . |
@omsoni - No workaround found yet. |
@michahirsch Still on the backlog to get done for the 2.0.0 release. Hoping to have Reactor updated for this soon. |
@michahirsch @s-bortolussi this should now be fixed in |
@nebhale awesome thanks a lot, I'll take a look and will try it out. |
@michahirsch It might present an issue in some circumstances that can be manifested by a wrong HOST header when sent out (using the proxy host vs the target host). Let us know if you face that situation. |
Since there's been no response on this issue in a couple of weeks, I'm going to close it. If you'd like to see it re-opened, please comment on the issue and I'll reopen it. |
Using 2.2.0.RELEASE -- I am getting java.nio.channels.UnresolvedAddressException I am using these builders:
|
Tried that right now. The same exception is now thrown on different thread (reactor-tcp-nio-1):
|
Hi, Found the issue. It is acutally in netty's code (or at least how it is used in cf client). In CF's it explicitly resets Netty's configured address resolver to The eventual result is that cf client operations will fail due to unresolved hosts when a proxy is configured. I tried searching around for any code that calls Netty's relevant configuration method This pull request should provide the needed API in Netty: reactor/reactor-netty#29 |
Hi again, I think another simpler solution is to simply resolve the proxy host as pull request: #614 |
@tareqhs I've checked out your branch and use it, but seems like is the same problem, or maybe I did something wrong.
|
Any solution when this occurs in case of direct connection when manual ping successful to the server? |
@varanasipavan6 Please open a new issue with more details of your issue. |
I'm using the cloudfoundry client behind an proxy and I get problems since the change to the reactor Netty HttpClient. The Netty HttpClient is using a
io.netty.resolver.DefaultNameResolver
to resolve the hostname. The hostname should be resolved by the proxy which actually is working but using theInetAddress.getByName(inetHost)
will always through anUnknownHostException
.Is there anyway to inject an own implementation of a
io.netty.resolver.InetNameResolver
?The text was updated successfully, but these errors were encountered: