ActiveMQ
  1. ActiveMQ
  2. AMQ-1514

patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 5.6.0
    • Component/s: Connector
    • Labels:
      None
    • Environment:

      windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1

    • Patch Info:
      Patch Available

      Description

      Could not find a way to configure an http proxy host/port with user/pass authentication.

      I am supplying a patch to allow this to be part of the options specified as part of the URI, for example,

      uri="static://(http://myserver:80?proxyHost=my.proxy.com%26proxyPort=80%26proxyUsername=username%26proxyPassword=password)"

      This is an enhancement based on #AMQ-1099.

      1. HttpTransportSupport.java
        3 kB
        john hyaduck
      2. http-proxy-credentials.patch
        3 kB
        john hyaduck
      3. HttpClientTransport.java
        9 kB
        john hyaduck
      4. ASF.LICENSE.NOT.GRANTED--HttpTransportSupport.java
        3 kB
        Sam Zhou
      5. ASF.LICENSE.NOT.GRANTED--HttpClientTransport.java
        9 kB
        Sam Zhou
      6. amq-proxy-cred.patch
        4 kB
        Timo Roessner

        Activity

        Hide
        Timothy Bish added a comment -

        Added this option using the APIs in HttpClient 4.1.2

        Show
        Timothy Bish added a comment - Added this option using the APIs in HttpClient 4.1.2
        Hide
        john hyaduck added a comment -

        patch used to rework prior 2008 patch for 5.3.2

        Show
        john hyaduck added a comment - patch used to rework prior 2008 patch for 5.3.2
        Hide
        john hyaduck added a comment -

        Files updated to rework outdated patch. These updates fix 5.3.2 to provide ?proxyUser="xxxx";proxyPassword capability to a http network connector. Tested with squid 2.7.

        Show
        john hyaduck added a comment - Files updated to rework outdated patch. These updates fix 5.3.2 to provide ?proxyUser="xxxx";proxyPassword capability to a http network connector. Tested with squid 2.7.
        Hide
        Timo Roessner added a comment -

        Patch to enable broker connections over authenticating http-proxies.

        Show
        Timo Roessner added a comment - Patch to enable broker connections over authenticating http-proxies.
        Hide
        Timo Roessner added a comment - - edited

        Hey folks,

        i stumbled into this problem and here is my solution:

        ---- Prehistory: ------

        1.)

        i believe the two afore submitted source files above will NOT work with current proxy-Servers (tested with squid 2.6.14 running on Ubuntu 7.10)

        I think that this is due to the fact that they use a quite dated authentication method. Connection requests using this method are denied by squid.

        2.)

        I am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add two libraries to get the broker to work when using the http-connector (see below)

        ------ Possible solution: ------

        I wrote a patch which uses

        org.apache.commons.httpclient.UsernamePasswordCredentials;

        and

        org.apache.commons.httpclient.auth.AuthScope;

        for supplying the credentials to the proxy.

        I tested it using:

        • AMQ v. 5.1 (stable release)
        • two brokers running on sles 9
        • squid 2.6.14 running on Ubuntu 7.10
        • a network-connector which looked like that:

        <networkConnector name="outbound_http" uri="static://(http://xxx.xxx.xxx.xxx:61617?proxyHost=xxx.xxx.xxx.xxx&amp;proxyPort=3128&amp;proxyUser=test&amp;proxyPassword=test)" networkTTL="5"/>

        Tests were ok and so far there weren't any problems with the patch.

        ------ Applying the patch: ------

        -> download the patch (the attachment amq-proxy-cred.patch above)
        -> download amq-source V.5.1
        -> unpack amq
        Then patch via:
        cd $unpacked_amq_source
        patch -p1 <amq-proxy-cred.patch

        ------ Build the sources as usual: ------

        export MAVEN_OPTS=-Xmx512M
        cd AMQ_SRC_DIR
        mvn clean install -Dmaven.test.skip=true -e

        ------ Install the broker: ------

        -> Installation as usual BUT:

        You have to add the following two libraries:

        • xstream-1.3.jar
        • commons-codec-1.3.jar

        to the brokers classpath. Simply copy them to $AMQ_HOME/lib.

        Show
        Timo Roessner added a comment - - edited Hey folks, i stumbled into this problem and here is my solution: ---- Prehistory: ------ 1.) i believe the two afore submitted source files above will NOT work with current proxy-Servers (tested with squid 2.6.14 running on Ubuntu 7.10) I think that this is due to the fact that they use a quite dated authentication method. Connection requests using this method are denied by squid. 2.) I am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add two libraries to get the broker to work when using the http-connector (see below) ------ Possible solution: ------ I wrote a patch which uses org.apache.commons.httpclient.UsernamePasswordCredentials; and org.apache.commons.httpclient.auth.AuthScope; for supplying the credentials to the proxy. I tested it using: AMQ v. 5.1 (stable release) two brokers running on sles 9 squid 2.6.14 running on Ubuntu 7.10 a network-connector which looked like that: <networkConnector name="outbound_http" uri="static://( http://xxx.xxx.xxx.xxx:61617?proxyHost=xxx.xxx.xxx.xxx&amp;proxyPort=3128&amp;proxyUser=test&amp;proxyPassword=test )" networkTTL="5"/> Tests were ok and so far there weren't any problems with the patch. ------ Applying the patch: ------ -> download the patch (the attachment amq-proxy-cred.patch above) -> download amq-source V.5.1 -> unpack amq Then patch via: cd $unpacked_amq_source patch -p1 <amq-proxy-cred.patch ------ Build the sources as usual: ------ export MAVEN_OPTS=-Xmx512M cd AMQ_SRC_DIR mvn clean install -Dmaven.test.skip=true -e ------ Install the broker: ------ -> Installation as usual BUT: You have to add the following two libraries: xstream-1.3.jar commons-codec-1.3.jar to the brokers classpath. Simply copy them to $AMQ_HOME/lib.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sam Zhou
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development