You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Sam Zhou (JIRA)" <ji...@apache.org> on 2007/12/07 17:30:27 UTC

[jira] Created: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

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

                 Key: AMQ-1514
                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
             Project: ActiveMQ
          Issue Type: Improvement
          Components: Connector
    Affects Versions: 4.1.1
         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
            Reporter: Sam Zhou
            Priority: Minor
         Attachments: HttpClientTransport.java, HttpTransportSupport.java

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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

Posted by "Timo Roessner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42592#action_42592 ] 

Timo Roessner commented on AMQ-1514:
------------------------------------

Hey folks, 

i believe the applied patch 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 the patch uses a quite dated authentication method. Connection requests using this method are denied by squid.

I wrote a patch which uses 

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

I tested it and it works fine.....

Furthermore i am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add the two libs:

- xstream-1.3.jar
- common-codecs

to the classpath to get i working at all.

To apply the patch, simply do something like:

cd $unpacked_amq_source
patch -p1 <amq-proxy-cred.patch

Since i can't upload anything here, i have to copy & paste the patch below:

diff -Naur old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
--- old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java	2008-05-01 20:54:05.000000000 +0200
+++ new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java	2008-05-08 15:02:49.000000000 +0200
@@ -33,6 +33,8 @@
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.methods.HeadMethod;
 import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -137,9 +139,13 @@
                 onException(IOExceptionSupport.create("Failed to perform GET on: " + remoteUrl + " Reason: " + e.getMessage(), e));
                 break;
             } finally {
-                httpMethod.getResponseBody();
-                httpMethod.releaseConnection();
-            }
+		try {
+			httpMethod.getResponseBody();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		httpMethod.releaseConnection();
+	    }
         }
     }
 
@@ -189,11 +195,17 @@
     protected void doStop(ServiceStopper stopper) throws Exception {
     }
 
-    protected HttpClient createHttpClient() {
+ protected HttpClient createHttpClient() {
         HttpClient client = new HttpClient();
         if (getProxyHost() != null) {
             client.getHostConfiguration().setProxy(getProxyHost(), getProxyPort());
         }
+        if(getProxyUser() != null && getProxyPassword() != null) {
+           client.getState().setProxyCredentials(
+                new AuthScope(getProxyHost(),  getProxyPort()),
+                new  UsernamePasswordCredentials(getProxyUser(),
+                                                 getProxyPassword()));
+        }
         return client;
     }
 
diff -Naur old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java
--- old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java	2008-05-01 20:54:05.000000000 +0200
+++ new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java	2008-05-08 15:06:32.000000000 +0200
@@ -31,6 +31,8 @@
     private URI remoteUrl;
     private String proxyHost;
     private int proxyPort = 8080;
+    private String proxyUser;
+    private String proxyPassword;
 
     public HttpTransportSupport(TextWireFormat textWireFormat, URI remoteUrl) {
         this.textWireFormat = textWireFormat;
@@ -74,4 +76,20 @@
     public void setProxyPort(int proxyPort) {
         this.proxyPort = proxyPort;
     }
+
+    public String getProxyUser() {
+	return proxyUser;
+    }
+
+    public void setProxyUser(String proxyUser) {
+	this.proxyUser = proxyUser;
+    }
+
+    public String getProxyPassword() {
+	return proxyPassword;
+    }
+
+    public void setProxyPassword(String proxyPassword) {
+	this.proxyPassword = proxyPassword;
+    }
 }
diff -Naur old/src/pom.xml new/src/pom.xml
--- old/src/pom.xml	2008-05-01 20:54:04.000000000 +0200
+++ new/src/pom.xml	2008-05-08 15:08:00.000000000 +0200
@@ -52,7 +52,7 @@
     <commons-collections-version>3.1</commons-collections-version>
     <openjpa-version>1.0.0</openjpa-version>
     <commons-dbcp-version>1.2.1</commons-dbcp-version>
-    <commons-httpclient-version>2.0.1</commons-httpclient-version>
+    <commons-httpclient-version>3.1</commons-httpclient-version>
     <commons-logging-version>1.1</commons-logging-version>
     <commons-pool-version>1.4</commons-pool-version>
     <commons-primitives-version>1.0</commons-primitives-version>


Scince

To apply the patch

> patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.
> -------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 4.1.1
>         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
>            Reporter: Sam Zhou
>            Priority: Minor
>         Attachments: HttpClientTransport.java, HttpTransportSupport.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

Posted by "Timo Roessner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42592#action_42592 ] 

j0llyr0g3r edited comment on AMQ-1514 at 5/8/08 8:27 AM:
------------------------------------------------------------

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.

 

      was (Author: j0llyr0g3r):
    Hey folks, 

i believe the applied patch 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 the patch uses a quite dated authentication method. Connection requests using this method are denied by squid.

I wrote a patch which uses 

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

I tested it and it works fine.....

Furthermore i am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add the two libs:

- xstream-1.3.jar
- common-codecs

to the classpath to get it working.

To apply the patch, simply do something like:

cd $unpacked_amq_source
patch -p1 <amq-proxy-cred.patch

For the patch itself -> see the attachment amq-proxy-cred.patch 
  
> patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.
> -------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 4.1.1
>         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
>            Reporter: Sam Zhou
>            Priority: Minor
>         Attachments: amq-proxy-cred.patch, HttpClientTransport.java, HttpTransportSupport.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

Posted by "john hyaduck (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

john hyaduck updated AMQ-1514:
------------------------------

    Attachment: HttpTransportSupport.java
                HttpClientTransport.java

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.

> patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.
> -------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 4.1.1
>         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
>            Reporter: Sam Zhou
>            Priority: Minor
>             Fix For: NEEDS_REVIEWED
>
>         Attachments: amq-proxy-cred.patch, HttpClientTransport.java, HttpClientTransport.java, HttpTransportSupport.java, HttpTransportSupport.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

Posted by "john hyaduck (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

john hyaduck updated AMQ-1514:
------------------------------

    Attachment: http-proxy-credentials.patch

patch used to rework prior 2008 patch for 5.3.2

> patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.
> -------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 4.1.1
>         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
>            Reporter: Sam Zhou
>            Priority: Minor
>             Fix For: NEEDS_REVIEWED
>
>         Attachments: amq-proxy-cred.patch, http-proxy-credentials.patch, HttpClientTransport.java, HttpClientTransport.java, HttpTransportSupport.java, HttpTransportSupport.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

Posted by "Timo Roessner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42592#action_42592 ] 

j0llyr0g3r edited comment on AMQ-1514 at 5/8/08 7:34 AM:
------------------------------------------------------------

Hey folks, 

i believe the applied patch 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 the patch uses a quite dated authentication method. Connection requests using this method are denied by squid.

I wrote a patch which uses 

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

I tested it and it works fine.....

Furthermore i am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add the two libs:

- xstream-1.3.jar
- common-codecs

to the classpath to get it working.

To apply the patch, simply do something like:

cd $unpacked_amq_source
patch -p1 <amq-proxy-cred.patch

For the patch itself -> see the attachment.

      was (Author: j0llyr0g3r):
    Hey folks, 

i believe the applied patch 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 the patch uses a quite dated authentication method. Connection requests using this method are denied by squid.

I wrote a patch which uses 

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

I tested it and it works fine.....

Furthermore i am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add the two libs:

- xstream-1.3.jar
- common-codecs

to the classpath to get i working at all.

To apply the patch, simply do something like:

cd $unpacked_amq_source
patch -p1 <amq-proxy-cred.patch

Since i can't upload anything here, i have to copy & paste the patch below:

diff -Naur old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
--- old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java	2008-05-01 20:54:05.000000000 +0200
+++ new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java	2008-05-08 15:02:49.000000000 +0200
@@ -33,6 +33,8 @@
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.methods.HeadMethod;
 import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -137,9 +139,13 @@
                 onException(IOExceptionSupport.create("Failed to perform GET on: " + remoteUrl + " Reason: " + e.getMessage(), e));
                 break;
             } finally {
-                httpMethod.getResponseBody();
-                httpMethod.releaseConnection();
-            }
+		try {
+			httpMethod.getResponseBody();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		httpMethod.releaseConnection();
+	    }
         }
     }
 
@@ -189,11 +195,17 @@
     protected void doStop(ServiceStopper stopper) throws Exception {
     }
 
-    protected HttpClient createHttpClient() {
+ protected HttpClient createHttpClient() {
         HttpClient client = new HttpClient();
         if (getProxyHost() != null) {
             client.getHostConfiguration().setProxy(getProxyHost(), getProxyPort());
         }
+        if(getProxyUser() != null && getProxyPassword() != null) {
+           client.getState().setProxyCredentials(
+                new AuthScope(getProxyHost(),  getProxyPort()),
+                new  UsernamePasswordCredentials(getProxyUser(),
+                                                 getProxyPassword()));
+        }
         return client;
     }
 
diff -Naur old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java
--- old/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java	2008-05-01 20:54:05.000000000 +0200
+++ new/src/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportSupport.java	2008-05-08 15:06:32.000000000 +0200
@@ -31,6 +31,8 @@
     private URI remoteUrl;
     private String proxyHost;
     private int proxyPort = 8080;
+    private String proxyUser;
+    private String proxyPassword;
 
     public HttpTransportSupport(TextWireFormat textWireFormat, URI remoteUrl) {
         this.textWireFormat = textWireFormat;
@@ -74,4 +76,20 @@
     public void setProxyPort(int proxyPort) {
         this.proxyPort = proxyPort;
     }
+
+    public String getProxyUser() {
+	return proxyUser;
+    }
+
+    public void setProxyUser(String proxyUser) {
+	this.proxyUser = proxyUser;
+    }
+
+    public String getProxyPassword() {
+	return proxyPassword;
+    }
+
+    public void setProxyPassword(String proxyPassword) {
+	this.proxyPassword = proxyPassword;
+    }
 }
diff -Naur old/src/pom.xml new/src/pom.xml
--- old/src/pom.xml	2008-05-01 20:54:04.000000000 +0200
+++ new/src/pom.xml	2008-05-08 15:08:00.000000000 +0200
@@ -52,7 +52,7 @@
     <commons-collections-version>3.1</commons-collections-version>
     <openjpa-version>1.0.0</openjpa-version>
     <commons-dbcp-version>1.2.1</commons-dbcp-version>
-    <commons-httpclient-version>2.0.1</commons-httpclient-version>
+    <commons-httpclient-version>3.1</commons-httpclient-version>
     <commons-logging-version>1.1</commons-logging-version>
     <commons-pool-version>1.4</commons-pool-version>
     <commons-primitives-version>1.0</commons-primitives-version>


Scince

To apply the patch
  
> patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.
> -------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 4.1.1
>         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
>            Reporter: Sam Zhou
>            Priority: Minor
>         Attachments: HttpClientTransport.java, HttpTransportSupport.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

Posted by "Timo Roessner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42592#action_42592 ] 

j0llyr0g3r edited comment on AMQ-1514 at 5/8/08 7:36 AM:
------------------------------------------------------------

Hey folks, 

i believe the applied patch 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 the patch uses a quite dated authentication method. Connection requests using this method are denied by squid.

I wrote a patch which uses 

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

I tested it and it works fine.....

Furthermore i am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add the two libs:

- xstream-1.3.jar
- common-codecs

to the classpath to get it working.

To apply the patch, simply do something like:

cd $unpacked_amq_source
patch -p1 <amq-proxy-cred.patch

For the patch itself -> see the attachment amq-proxy-cred.patch 

      was (Author: j0llyr0g3r):
    Hey folks, 

i believe the applied patch 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 the patch uses a quite dated authentication method. Connection requests using this method are denied by squid.

I wrote a patch which uses 

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

I tested it and it works fine.....

Furthermore i am not sure if the http-connector worked at all, because in AMQ 5.1 i had to add the two libs:

- xstream-1.3.jar
- common-codecs

to the classpath to get it working.

To apply the patch, simply do something like:

cd $unpacked_amq_source
patch -p1 <amq-proxy-cred.patch

For the patch itself -> see the attachment.
  
> patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.
> -------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 4.1.1
>         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
>            Reporter: Sam Zhou
>            Priority: Minor
>         Attachments: amq-proxy-cred.patch, HttpClientTransport.java, HttpTransportSupport.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1514) patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.

Posted by "Timo Roessner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Roessner updated AMQ-1514:
-------------------------------

    Attachment: amq-proxy-cred.patch

Patch to enable broker connections over authenticating http-proxies.

> patch HTTP connector to support proxy authentication if proxyUsername and proxyPassword provided.
> -------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1514
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 4.1.1
>         Environment: windows xp, java 1.5, servicemix 3.1.1 and activemq 4.1.1
>            Reporter: Sam Zhou
>            Priority: Minor
>         Attachments: amq-proxy-cred.patch, HttpClientTransport.java, HttpTransportSupport.java
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.