HTTPCLIENT-1834: Fix up the conflicts with patch HTTPCLIENT-1662.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1787727 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
248cf5c96d
commit
d07ee6fbc7
|
@ -318,7 +318,7 @@ public class CredSspScheme implements AuthScheme
|
||||||
final int ntlmFlags = getNtlmFlags();
|
final int ntlmFlags = getNtlmFlags();
|
||||||
final ByteBuffer buf = allocateOutBuffer();
|
final ByteBuffer buf = allocateOutBuffer();
|
||||||
type1Message = new NTLMEngineImpl.Type1Message(
|
type1Message = new NTLMEngineImpl.Type1Message(
|
||||||
ntcredentials.getDomain(), ntcredentials.getWorkstation(), ntlmFlags);
|
ntcredentials.getNetbiosDomain(), ntcredentials.getWorkstation(), ntlmFlags);
|
||||||
final byte[] ntlmNegoMessageEncoded = type1Message.getBytes();
|
final byte[] ntlmNegoMessageEncoded = type1Message.getBytes();
|
||||||
final CredSspTsRequest req = CredSspTsRequest.createNegoToken( ntlmNegoMessageEncoded );
|
final CredSspTsRequest req = CredSspTsRequest.createNegoToken( ntlmNegoMessageEncoded );
|
||||||
req.encode( buf );
|
req.encode( buf );
|
||||||
|
@ -336,7 +336,7 @@ public class CredSspScheme implements AuthScheme
|
||||||
final Certificate peerServerCertificate = getPeerServerCertificate();
|
final Certificate peerServerCertificate = getPeerServerCertificate();
|
||||||
|
|
||||||
type3Message = new NTLMEngineImpl.Type3Message(
|
type3Message = new NTLMEngineImpl.Type3Message(
|
||||||
ntcredentials.getDomain(),
|
ntcredentials.getNetbiosDomain(),
|
||||||
ntcredentials.getWorkstation(),
|
ntcredentials.getWorkstation(),
|
||||||
ntcredentials.getUserName(),
|
ntcredentials.getUserName(),
|
||||||
ntcredentials.getPassword(),
|
ntcredentials.getPassword(),
|
||||||
|
|
|
@ -1085,28 +1085,6 @@ final class NTLMEngineImpl implements NTLMEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Strip dot suffix from a name */
|
|
||||||
private static String stripDotSuffix(final String value) {
|
|
||||||
if (value == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final int index = value.indexOf(".");
|
|
||||||
if (index != -1) {
|
|
||||||
return value.substring(0, index);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Convert host to standard form */
|
|
||||||
private static String convertHost(final String host) {
|
|
||||||
return stripDotSuffix(host);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Convert domain to standard form */
|
|
||||||
private static String convertDomain(final String domain) {
|
|
||||||
return stripDotSuffix(domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** NTLM message generation, base class */
|
/** NTLM message generation, base class */
|
||||||
static class NTLMMessage {
|
static class NTLMMessage {
|
||||||
/** The current response */
|
/** The current response */
|
||||||
|
@ -1293,10 +1271,9 @@ final class NTLMEngineImpl implements NTLMEngine {
|
||||||
super();
|
super();
|
||||||
this.flags = ((flags == null)?getDefaultFlags():flags);
|
this.flags = ((flags == null)?getDefaultFlags():flags);
|
||||||
|
|
||||||
// Strip off domain name from the host!
|
// See HTTPCLIENT-1662
|
||||||
final String unqualifiedHost = convertHost(host);
|
final String unqualifiedHost = host;
|
||||||
// Use only the base domain name!
|
final String unqualifiedDomain = domain;
|
||||||
final String unqualifiedDomain = convertDomain(domain);
|
|
||||||
|
|
||||||
hostBytes = unqualifiedHost != null ?
|
hostBytes = unqualifiedHost != null ?
|
||||||
unqualifiedHost.getBytes(UNICODE_LITTLE_UNMARKED) : null;
|
unqualifiedHost.getBytes(UNICODE_LITTLE_UNMARKED) : null;
|
||||||
|
|
Loading…
Reference in New Issue