mirror of https://github.com/apache/activemq.git
Apply patch from Pavlo Vasylchenko
This commit is contained in:
parent
a35be76ff3
commit
d919db5e3d
|
@ -47,6 +47,8 @@ import org.apache.http.client.methods.HttpOptions;
|
||||||
import org.apache.http.client.methods.HttpPost;
|
import org.apache.http.client.methods.HttpPost;
|
||||||
import org.apache.http.conn.ClientConnectionManager;
|
import org.apache.http.conn.ClientConnectionManager;
|
||||||
import org.apache.http.conn.params.ConnRoutePNames;
|
import org.apache.http.conn.params.ConnRoutePNames;
|
||||||
|
import org.apache.http.conn.scheme.PlainSocketFactory;
|
||||||
|
import org.apache.http.conn.scheme.Scheme;
|
||||||
import org.apache.http.entity.ByteArrayEntity;
|
import org.apache.http.entity.ByteArrayEntity;
|
||||||
import org.apache.http.impl.client.BasicResponseHandler;
|
import org.apache.http.impl.client.BasicResponseHandler;
|
||||||
import org.apache.http.impl.client.DefaultHttpClient;
|
import org.apache.http.impl.client.DefaultHttpClient;
|
||||||
|
@ -325,6 +327,11 @@ public class HttpClientTransport extends HttpTransportSupport {
|
||||||
HttpHost proxy = new HttpHost(getProxyHost(), getProxyPort());
|
HttpHost proxy = new HttpHost(getProxyHost(), getProxyPort());
|
||||||
client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
|
client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
|
||||||
|
|
||||||
|
if (client.getConnectionManager().getSchemeRegistry().get("http") == null) {
|
||||||
|
client.getConnectionManager().getSchemeRegistry().register(
|
||||||
|
new Scheme("http", getProxyPort(), PlainSocketFactory.getSocketFactory()));
|
||||||
|
}
|
||||||
|
|
||||||
if(getProxyUser() != null && getProxyPassword() != null) {
|
if(getProxyUser() != null && getProxyPassword() != null) {
|
||||||
client.getCredentialsProvider().setCredentials(
|
client.getCredentialsProvider().setCredentials(
|
||||||
new AuthScope(getProxyHost(), getProxyPort()),
|
new AuthScope(getProxyHost(), getProxyPort()),
|
||||||
|
|
Loading…
Reference in New Issue