Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5248

camel-http4 does not respect nonProxyHosts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jboss-fuse-6.3
    • jboss-fuse-6.2.1
    • Camel
    • None
    • % %
    • Hide

      The problem can easily be demonstrated using a piece of code like that attached. In this example, 192.168.1.114 is the IP number of the machine running the route, and therefore not reachable through the proxy. Using "localhost" here probably won't prove anything, because the JVMs stock HTTP client excludes localhost and its variants from proxying by default, and the HTTP client used by Camel might do the same (for all I know).

      Looking at the network traffic using tcpdump, I see HTTP requests for 192.168.1.114 being sent to the proxy, indicating that nonProxyHosts is not working.

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
             xmlns:cxf="http://camel.apache.org/schema/cxf"
             xmlns:cxfcore="http://cxf.apache.org/core"
             xmlns:osgi="http://www.springframework.org/schema/osgi"
             xsi:schemaLocation="
               http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
               http://www.springframework.org/schema/osgi-compendium  http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium-1.2.xsd
               http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
               http://camel.apache.org/schema/cxf            http://camel.apache.org/schema/cxf/camel-cxf.xsd
               http://cxf.apache.org/core                    http://cxf.apache.org/schemas/core.xsd
      	">
          <camelContext id="XXX" xmlns="http://camel.apache.org/schema/spring">
      <properties>
              <property key="http.proxyHost" value="squid.corp.redhat.com"/>
              <property key="http.proxyPort" value="3128"/>
              <property key="http.nonProxyHosts" value="192.168.1.114"/>
          </properties>
              <route>
                  <from uri="timer://foo?period=1000&amp;fixedRate=true"/>
                  <to uri="http4://192.168.1.114:8181/cxf/?proxyHost=squid.corp.redhat.com&amp;proxyPort2=3128"/>
                  <to uri="log://foo"/>
              </route>
          </camelContext>
      </beans>
      
      Show
      The problem can easily be demonstrated using a piece of code like that attached. In this example, 192.168.1.114 is the IP number of the machine running the route, and therefore not reachable through the proxy. Using "localhost" here probably won't prove anything, because the JVMs stock HTTP client excludes localhost and its variants from proxying by default, and the HTTP client used by Camel might do the same (for all I know). Looking at the network traffic using tcpdump, I see HTTP requests for 192.168.1.114 being sent to the proxy, indicating that nonProxyHosts is not working. <?xml version= "1.0" encoding= "UTF-8" ?> <beans xmlns= "http: //www.springframework.org/schema/beans" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xmlns:osgix= "http: //www.springframework.org/schema/osgi-compendium" xmlns:cxf= "http: //camel.apache.org/schema/cxf" xmlns:cxfcore= "http: //cxf.apache.org/core" xmlns:osgi= "http: //www.springframework.org/schema/osgi" xsi:schemaLocation=" http: //www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http: //www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium-1.2.xsd http: //camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http: //camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd http: //cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd "> <camelContext id= "XXX" xmlns= "http: //camel.apache.org/schema/spring" > <properties> <property key= "http.proxyHost" value= "squid.corp.redhat.com" /> <property key= "http.proxyPort" value= "3128" /> <property key= "http.nonProxyHosts" value= "192.168.1.114" /> </properties> <route> <from uri= "timer: //foo?period=1000&amp;fixedRate= true " /> <to uri= "http4: //192.168.1.114:8181/cxf/?proxyHost=squid.corp.redhat.com&amp;proxyPort2=3128" /> <to uri= "log: //foo" /> </route> </camelContext> </beans>
    • 6.3 Sprint 4 (Mar 28 - Apr 29)

      HTTP proxy settings are respect where set on the CamelContext – there are http.proxyHost and http.proxyPort, analogous to the usual JVM system properties of the same name.

      However, the property http.nonProxyHosts is not respected, and all HTTP traffic from the component goes to the proxy. Where connections need to be made to local machines, this is generally catastrophic.

            acosenti Andrea Cosentino
            rhn-support-kboone Kevin Boone
            Petr Pecka Petr Pecka
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: