Are the nonProxyHosts evaluated correctly in RestClientBuilderImpl? #142
Replies: 2 comments 1 reply
-
What version RESTEasy and RESTEasy MicroProfile are you using? I thought this was fixed with #10, but we may have missed something. I do think RESTEasy should be duplicating what the JVM does. If not, IMO, it's a bug we should fix. |
Beta Was this translation helpful? Give feedback.
-
We're using 1.0.0.Final of RESTeasy Microprofile and 5.0.1.Final of RESTeasy. RESTeasy Microprofile 1.0.0.Final does contain Fix #10 so upgrading to a newer version would not help. Besides we're still bound to Java 8 currently - sad to say. The issue in #10 as I understand it was that you could not directly use the |
Beta Was this translation helpful? Give feedback.
-
I'm having an issue with the way the
http.nonProxyHosts
Sytem Property is evaluated byorg.jboss.resteasy.microprofile.clientRestClientBuilderImpl
. I have thought of filing an Issue but I think this might be viewed as a question of design so let's discuss it.Scenario:
I need to access Service
my-pod.someserver.somecluster.mycompany.com
For some reason there are Proxy settings
-Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=*.mycompany.com|127.*|localhost
Problem:
Given the Implementation of RestClientBuilderImpl.getProxyHostsAsRegex() my Service call will be directed via the Proxy.
Why is this? Because said method converts the Pattern
*.mycompany.com
to a regex[A-Za-z0-9-]*\\.mycompany\\.com
. This regex does not matchmy-pod.someserver.somecluster.mycompany.com
. It will match no address containing a.
that is not explicitely written. And of course it will not match127.0.0.1
. This behaviour also is different from what's stated on the Oracle Web Site.The only solution is for me - or whoever is in control of the JVM arguments - to add
*.someserver.somecluster.mycompany.com
to thehttp.nonProxyHosts
Property. Assuming there are a number of different testing environments this can amount to an awful lot of*.someotherserver.productioncluster.mycompany.com
-stuff to configure - that's what wildcards were introduced for in the first place, I assume.So wouldn't it make sense to change the implementation of the Pattern Matching around
RestClientBuilderImpl.getProxyHostsAsRegex()
andRestClientBuilderImpl.build()
to be more useful?A minimal change to make the implementation fit my needs might be to simply expand
[A-Za-z0-9-]*
to[A-Za-z0-9-\\.]*
But - frankly: the Pattern
.*\\.mycompany\\.com
would do the job perfectly well.Beta Was this translation helpful? Give feedback.
All reactions