You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2018/12/16 17:16:52 UTC
[httpcomponents-client] branch master updated (df4b6d5 -> eac6c06)
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git.
from df4b6d5 Upgraded HttpClient version to 5.0-beta4-SNAPSHOT
new b7a945f Updated the set of project report generated by Maven
new eac6c06 Better handling of http(s).proxyUser and http(s).proxyPassword
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../auth/SystemDefaultCredentialsProvider.java | 51 +++++++++++++++-------
pom.xml | 6 ++-
2 files changed, 39 insertions(+), 18 deletions(-)
[httpcomponents-client] 02/02: Better handling of http(s).proxyUser
and http(s).proxyPassword
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit eac6c062b586196d32b7770d7052148acaf3c276
Author: Jens Borgland <jb...@tibco.com>
AuthorDate: Wed Dec 12 15:58:39 2018 +0100
Better handling of http(s).proxyUser and http(s).proxyPassword
---
.../auth/SystemDefaultCredentialsProvider.java | 51 +++++++++++++++-------
1 file changed, 35 insertions(+), 16 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
index 90e641a..a4c0b0e 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
@@ -135,22 +135,13 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
protocol, authscope, Authenticator.RequestorType.PROXY, clientContext);
}
if (systemcreds == null) {
- final String proxyHost = System.getProperty(protocol + ".proxyHost");
- if (proxyHost != null) {
- final String proxyPort = System.getProperty(protocol + ".proxyPort");
- if (proxyPort != null) {
- try {
- final AuthScope systemScope = new AuthScope(proxyHost, Integer.parseInt(proxyPort));
- if (authscope.match(systemScope) >= 0) {
- final String proxyUser = System.getProperty(protocol + ".proxyUser");
- if (proxyUser != null) {
- final String proxyPassword = System.getProperty(protocol + ".proxyPassword");
- systemcreds = new PasswordAuthentication(proxyUser, proxyPassword != null ? proxyPassword.toCharArray() : new char[] {});
- }
- }
- } catch (final NumberFormatException ex) {
- }
- }
+ // Look for values given using http.proxyUser/http.proxyPassword or
+ // https.proxyUser/https.proxyPassword. We cannot simply use the protocol from
+ // the origin since a proxy retrieved from https.proxyHost/https.proxyPort will
+ // still use http as protocol
+ systemcreds = getProxyCredentials("http", authscope);
+ if (systemcreds == null) {
+ systemcreds = getProxyCredentials("https", authscope);
}
}
if (systemcreds != null) {
@@ -169,6 +160,34 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
return null;
}
+ private static PasswordAuthentication getProxyCredentials(final String protocol, final AuthScope authscope) {
+ final String proxyHost = System.getProperty(protocol + ".proxyHost");
+ if (proxyHost == null) {
+ return null;
+ }
+ final String proxyPort = System.getProperty(protocol + ".proxyPort");
+ if (proxyPort == null) {
+ return null;
+ }
+
+ try {
+ final AuthScope systemScope = new AuthScope(proxyHost, Integer.parseInt(proxyPort));
+ if (authscope.match(systemScope) >= 0) {
+ final String proxyUser = System.getProperty(protocol + ".proxyUser");
+ if (proxyUser == null) {
+ return null;
+ }
+ final String proxyPassword = System.getProperty(protocol + ".proxyPassword");
+
+ return new PasswordAuthentication(proxyUser,
+ proxyPassword != null ? proxyPassword.toCharArray() : new char[] {});
+ }
+ } catch (final NumberFormatException ex) {
+ }
+
+ return null;
+ }
+
@Override
public void clear() {
internal.clear();
[httpcomponents-client] 01/02: Updated the set of project report
generated by Maven
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit b7a945ff9179504e9e2b3fa3a69bac2bf168eb0b
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun Dec 16 18:11:19 2018 +0100
Updated the set of project report generated by Maven
---
pom.xml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 13aaa8d..9ff0ee4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -364,9 +364,11 @@
<reportSets>
<reportSet>
<reports>
+ <report>dependency-info</report>
<report>dependency-management</report>
- <report>issue-tracking</report>
- <report>license</report>
+ <report>issue-management</report>
+ <report>licenses</report>
+ <report>mailing-lists</report>
<report>scm</report>
<report>summary</report>
</reports>