/** * {@inheritDoc} */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { // Should never get here ! throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ")."); } }
/** * Check if the given property(ies) is(are) set. Otherwise throws a * {@link ProxyAuthException}. */ public void checkRequiredProperties(String... propNames) throws ProxyAuthException { StringBuilder sb = new StringBuilder(); for (String propertyName : propNames) { if (properties.get(propertyName) == null) { sb.append(propertyName).append(' '); } } if (sb.length() > 0) { sb.append("property(ies) missing in request"); throw new ProxyAuthException(sb.toString()); } }
/** * {@inheritDoc} */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { // Should never get here ! throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ")."); } }
/** * {@inheritDoc} */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { // Should never get here ! throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ")."); } }
/** * Check if the given property(ies) is(are) set. Otherwise throws a * {@link ProxyAuthException}. * * @param propNames The list of property name to check * @throws ProxyAuthException If we get an error during the proxy authentication */ public void checkRequiredProperties(String... propNames) throws ProxyAuthException { StringBuilder sb = new StringBuilder(); for (String propertyName : propNames) { if (properties.get(propertyName) == null) { sb.append(propertyName).append(' '); } } if (sb.length() > 0) { sb.append("property(ies) missing in request"); throw new ProxyAuthException(sb.toString()); } }
/** * Check if the given property(ies) is(are) set. Otherwise throws a * {@link ProxyAuthException}. * * @param propNames The list of property name to check * @throws ProxyAuthException If we get an error during the proxy authentication */ public void checkRequiredProperties(String... propNames) throws ProxyAuthException { StringBuilder sb = new StringBuilder(); for (String propertyName : propNames) { if (properties.get(propertyName) == null) { sb.append(propertyName).append(' '); } } if (sb.length() > 0) { sb.append("property(ies) missing in request"); throw new ProxyAuthException(sb.toString()); } }
/** * {@inheritDoc} */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { if (response.getStatusCode() != 407) { throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ")."); } } }
/** * {@inheritDoc} */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { if (response.getStatusCode() != 407) { throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ")."); } } }
/** * {@inheritDoc} */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { if (response.getStatusCode() != 407) { throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ")."); } } }
throw new ProxyAuthException("Unexpected error while reading server challenge !"); proxyIoSession.getCharsetName())); } catch (IOException e) { throw new ProxyAuthException("Unable to decode the base64 encoded NTLM challenge", e); throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ").");
throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ")."); throw new ProxyAuthException("Server doesn't support digest authentication method !"); proxyIoSession.getCharsetName())); } catch (Exception e) { throw new ProxyAuthException("Parsing of server digest directives failed", e); throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ").");
throw new ProxyAuthException("Unexpected error while reading server challenge !"); proxyIoSession.getCharsetName())); } catch (IOException e) { throw new ProxyAuthException("Unable to decode the base64 encoded NTLM challenge", e); throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ").");
throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ")."); throw new ProxyAuthException("Server doesn't support digest authentication method !"); proxyIoSession.getCharsetName())); } catch (Exception e) { throw new ProxyAuthException("Parsing of server digest directives failed", e); throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ").");
throw new ProxyAuthException( "Unexpected error while reading server challenge !"); proxyIoSession.getCharsetName())); } catch (IOException e) { throw new ProxyAuthException( "Unable to decode the base64 encoded NTLM challenge", e); throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ").");
if (response.getStatusCode() != 401 && response.getStatusCode() != 407) { throw new ProxyAuthException( "Received unexpected response code (" + response.getStatusLine() + ")."); throw new ProxyAuthException( "Server doesn't support digest authentication method !"); .substring(7).getBytes(proxyIoSession.getCharsetName())); } catch (Exception e) { throw new ProxyAuthException( "Parsing of server digest directives failed", e); throw new ProxyAuthException("Received unexpected response code (" + response.getStatusLine() + ").");
throw new ProxyAuthException("Authentication challenge not received"); throw new ProxyAuthException("Unknown algorithm required by server"); map.put("cnonce", cnonce); } catch (UnsupportedEncodingException e) { throw new ProxyAuthException("Unable to encode cnonce", e); throw new ProxyAuthException("No supported qop option available"); throw new ProxyAuthException("Digest response computing failed", e);
throw new ProxyAuthException("Authentication challenge not received"); throw new ProxyAuthException("Unknown algorithm required by server"); map.put("cnonce", cnonce); } catch (UnsupportedEncodingException e) { throw new ProxyAuthException("Unable to encode cnonce", e); throw new ProxyAuthException("No supported qop option available"); throw new ProxyAuthException("Digest response computing failed", e);
throw new ProxyAuthException( "Authentication challenge not received"); throw new ProxyAuthException( "Unknown algorithm required by server"); map.put("cnonce", cnonce); } catch (UnsupportedEncodingException e) { throw new ProxyAuthException( "Unable to encode cnonce", e); throw new ProxyAuthException( "No supported qop option available"); throw new ProxyAuthException( "Digest response computing failed", e);
/** * {@inheritDoc} */ @Override public void doHandshake(final NextFilter nextFilter) throws ProxyAuthException { logger.debug(" doHandshake()"); if (step > 0) { throw new ProxyAuthException("Authentication request already sent"); } // Send request HttpProxyRequest req = (HttpProxyRequest) request; Map<String, List<String>> headers = req.getHeaders() != null ? req.getHeaders() : new HashMap<String, List<String>>(); String username = req.getProperties().get(HttpProxyConstants.USER_PROPERTY); String password = req.getProperties().get(HttpProxyConstants.PWD_PROPERTY); StringUtilities.addValueToHeader(headers, "Proxy-Authorization", "Basic " + createAuthorization(username, password), true); addKeepAliveHeaders(headers); req.setHeaders(headers); writeRequest(nextFilter, req); step++; }
/** * {@inheritDoc} */ @Override public void doHandshake(final NextFilter nextFilter) throws ProxyAuthException { logger.debug(" doHandshake()"); if (step > 0) { throw new ProxyAuthException("Authentication request already sent"); } // Send request HttpProxyRequest req = (HttpProxyRequest) request; Map<String, List<String>> headers = req.getHeaders() != null ? req.getHeaders() : new HashMap<String, List<String>>(); String username = req.getProperties().get(HttpProxyConstants.USER_PROPERTY); String password = req.getProperties().get(HttpProxyConstants.PWD_PROPERTY); StringUtilities.addValueToHeader(headers, "Proxy-Authorization", "Basic " + createAuthorization(username, password), true); addKeepAliveHeaders(headers); req.setHeaders(headers); writeRequest(nextFilter, req); step++; }