Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-08-11 20:46:44 +0000
committerThomas Wolf2019-10-07 17:53:10 +0000
commit2abd3c43bd61a6e06e2ea0ecab2d9f769a7223d3 (patch)
tree97f070611c00d772ce219b358d89125025a22655 /org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http
parent7192d9aecd3005d16de2496f73c73008654868a6 (diff)
downloadjgit-2abd3c43bd61a6e06e2ea0ecab2d9f769a7223d3.tar.gz
jgit-2abd3c43bd61a6e06e2ea0ecab2d9f769a7223d3.tar.xz
jgit-2abd3c43bd61a6e06e2ea0ecab2d9f769a7223d3.zip
Apache HTTP: support proxy authentication
Add a credentials provider that forwards to the java.net.Authenticator. Needed to support proxies requiring authentication. Bug: 549832 Change-Id: I181ee27a6c9f1b3fa402ce58affdd5ff3f7c96c9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http')
-rw-r--r--org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
index f92c5df792..9d9e2f882d 100644
--- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
+++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
@@ -92,6 +92,7 @@ import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.client.SystemDefaultCredentialsProvider;
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.transport.http.HttpConnection;
@@ -165,6 +166,8 @@ public class HttpClientConnection implements HttpConnection {
new BasicHttpClientConnectionManager(registry));
}
clientBuilder.setDefaultRequestConfig(configBuilder.build());
+ clientBuilder.setDefaultCredentialsProvider(
+ new SystemDefaultCredentialsProvider());
client = clientBuilder.build();
}

Back to the top