Skip to content

Commit

Permalink
Merge pull request #351 from snieguu/master
Browse files Browse the repository at this point in the history
Version 2.67.3 proper configuration for ApacheHttpClient proxy
  • Loading branch information
lastverb authored Nov 20, 2018
2 parents b1e0f7a + 2ad31b7 commit 6afd696
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.testdroid</groupId>
<artifactId>testdroid-api</artifactId>
<version>2.67.2</version>
<version>2.67.3</version>
<packaging>jar</packaging>
<name>Testdroid API v2</name>
<url>https://github.com/bitbar/testdroid-api</url>
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/testdroid/api/DefaultAPIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.AuthCache;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.conn.params.ConnRouteParams;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.impl.client.BasicAuthCache;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.DefaultProxyRoutePlanner;
import org.apache.http.params.HttpConnectionParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -80,7 +79,7 @@ public DefaultAPIClient(
String cloudURL, String username, String password, HttpHost proxy, boolean skipCheckCertificate) {
this(cloudURL, username, password, skipCheckCertificate);
DefaultHttpClient apacheClient = (DefaultHttpClient) ((ApacheHttpTransport) httpTransport).getHttpClient();
ConnRouteParams.setDefaultProxy(apacheClient.getParams(), proxy);
apacheClient.setRoutePlanner(new DefaultProxyRoutePlanner(proxy));
}

public DefaultAPIClient(
Expand All @@ -89,7 +88,6 @@ public DefaultAPIClient(
this(cloudURL, username, password, proxy, skipCheckCertificate);

DefaultHttpClient apacheClient = (DefaultHttpClient) ((ApacheHttpTransport) httpTransport).getHttpClient();
apacheClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
apacheClient.getCredentialsProvider().setCredentials(
new AuthScope(proxy.getHostName(), proxy.getPort()),
new UsernamePasswordCredentials(proxyUser, proxyPassword));
Expand Down

0 comments on commit 6afd696

Please sign in to comment.