diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2019-08-11 22:46:44 +0200 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2019-10-07 13:53:10 -0400 |
commit | 2abd3c43bd61a6e06e2ea0ecab2d9f769a7223d3 (patch) | |
tree | 97f070611c00d772ce219b358d89125025a22655 | |
parent | 7192d9aecd3005d16de2496f73c73008654868a6 (diff) | |
download | jgit-2abd3c43bd61a6e06e2ea0ecab2d9f769a7223d3.tar.gz 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>
-rw-r--r-- | org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java | 3 |
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(); } |