HTTPCLIENT-1888: Regression in SystemDefaultCredentialsProvider#getCredentials causing NPE
This commit is contained in:
parent
ea73f439e9
commit
5bed670873
|
@ -190,8 +190,7 @@ abstract class AuthenticationStrategyImpl implements AuthenticationStrategy {
|
||||||
authScheme.processChallenge(challenge);
|
authScheme.processChallenge(challenge);
|
||||||
|
|
||||||
final AuthScope authScope = new AuthScope(
|
final AuthScope authScope = new AuthScope(
|
||||||
authhost.getHostName(),
|
authhost,
|
||||||
authhost.getPort(),
|
|
||||||
authScheme.getRealm(),
|
authScheme.getRealm(),
|
||||||
authScheme.getSchemeName());
|
authScheme.getSchemeName());
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class SystemDefaultCredentialsProvider implements CredentialsProvider {
|
||||||
final String host = authscope.getHost();
|
final String host = authscope.getHost();
|
||||||
if (host != null) {
|
if (host != null) {
|
||||||
final HttpHost origin = authscope.getOrigin();
|
final HttpHost origin = authscope.getOrigin();
|
||||||
final String protocol = origin != null ? origin.getSchemeName() : (origin.getPort() == 443 ? "https" : "http");
|
final String protocol = origin != null ? origin.getSchemeName() : (authscope.getPort() == 443 ? "https" : "http");
|
||||||
PasswordAuthentication systemcreds = getSystemCreds(protocol, authscope, Authenticator.RequestorType.SERVER);
|
PasswordAuthentication systemcreds = getSystemCreds(protocol, authscope, Authenticator.RequestorType.SERVER);
|
||||||
if (systemcreds == null) {
|
if (systemcreds == null) {
|
||||||
systemcreds = getSystemCreds(protocol, authscope, Authenticator.RequestorType.PROXY);
|
systemcreds = getSystemCreds(protocol, authscope, Authenticator.RequestorType.PROXY);
|
||||||
|
|
Loading…
Reference in New Issue