Skip to content

Commit 435d9dc

Browse files
committed
fixes bug with setting of HTTP proxy value
in newer version of Apache HTTPClient the proxy setting was being ignored
1 parent 595c1fe commit 435d9dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libnetcipher/src/info/guardianproject/onionkit/trust/StrongHttpsClient.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.util.Log;
2121
import ch.boye.httpclientandroidlib.HttpHost;
2222
import ch.boye.httpclientandroidlib.conn.ClientConnectionOperator;
23+
import ch.boye.httpclientandroidlib.conn.params.ConnRoutePNames;
2324
import ch.boye.httpclientandroidlib.conn.scheme.PlainSocketFactory;
2425
import ch.boye.httpclientandroidlib.conn.scheme.Scheme;
2526
import ch.boye.httpclientandroidlib.conn.scheme.SchemeRegistry;
@@ -152,9 +153,9 @@ public void useProxy(boolean enableTor, String type, String host, int port)
152153
{
153154
this.proxyType = type;
154155

155-
HttpHost proxyHost = new HttpHost(host, port);
156-
getParams().setParameter(type, proxyHost);
157-
156+
HttpHost proxyHost = new HttpHost(host, port, type);
157+
getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
158+
158159
if (type.equalsIgnoreCase("socks"))
159160
{
160161
this.proxyHost = proxyHost;

0 commit comments

Comments
 (0)