I'm having an issue with the way the http.nonProxyHosts Sytem Property is evaluated by org.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 match my-pod.someserver.somecluster.mycompany.com. It will match no address containing a . that is not explicitely written. And of course it will not match 127.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 the http.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() and RestClientBuilderImpl.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.
Originally posted by @arne-reinhardt in #142
I'm having an issue with the way the
http.nonProxyHostsSytem 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.comFor some reason there are Proxy settings
-Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=*.mycompany.com|127.*|localhostProblem:
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.comto 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.comto thehttp.nonProxyHostsProperty. 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\\.comwould do the job perfectly well.Originally posted by @arne-reinhardt in #142