// Header should look like :
// Proxy-Authenticate: NTLM still_some_more_stuff
String challengeResponse = getNTLMHeader(response);
if (challengeResponse == null || challengeResponse.length() < 5) {
throw new ProxyAuthException("Unexpected error while reading server challenge !");
}
try {
challengePacket = Base64.decodeBase64(challengeResponse.substring(5).getBytes(
proxyIoSession.getCharsetName()));
} catch (IOException e) {
throw new ProxyAuthException("Unable to decode the base64 encoded NTLM challenge", e);
}
step = 2;
} else {
throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ").");
}
}