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);
|
||||
|
||||
final AuthScope authScope = new AuthScope(
|
||||
authhost.getHostName(),
|
||||
authhost.getPort(),
|
||||
authhost,
|
||||
authScheme.getRealm(),
|
||||
authScheme.getSchemeName());
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ public class SystemDefaultCredentialsProvider implements CredentialsProvider {
|
|||
final String host = authscope.getHost();
|
||||
if (host != null) {
|
||||
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);
|
||||
if (systemcreds == null) {
|
||||
systemcreds = getSystemCreds(protocol, authscope, Authenticator.RequestorType.PROXY);
|
||||
|
|
Loading…
Reference in New Issue