invaliArgExc.printStackTrace();
}
// Now can begin to build the authentication header using a MD5
// digest scheme
WWWAuthenticateHeader wwwAuthenticateHeader = (WWWAuthenticateHeader) response
.getHeader(WWWAuthenticateHeader.NAME);
ProxyAuthenticateHeader proxyAuthenticateHeader = (ProxyAuthenticateHeader) response
.getHeader(ProxyAuthenticateHeader.NAME);
String realm = null;
String nonce = null;
// Check whether we've received an wwwAuthenticationHeader
// or a ProxyAuthenticationHeader from the proxy server
if (wwwAuthenticateHeader != null) {
if (log.isDebugEnabled()) {
log.debug("wwwAuthenticateHeader found!");
}
// Retrieve the realm from the authentication header
realm = wwwAuthenticateHeader.getRealm();
// Retrieve the nonce from the wwwAuthenticateHeader
nonce = wwwAuthenticateHeader.getNonce();
} else if (proxyAuthenticateHeader != null) {
if (log.isDebugEnabled()) {
log.debug("ProxyAuthenticateHeader found!");
}