Package org.apache.mina.proxy

Examples of org.apache.mina.proxy.ProxyAuthException


                sb.append(propertyName).append(' ');
            }
        }
        if (sb.length() > 0) {
            sb.append("property(ies) missing in request");
            throw new ProxyAuthException(sb.toString());
        }
    }
View Full Code Here


                sb.append(propertyName).append(' ');
            }
        }
        if (sb.length() > 0) {
            sb.append("property(ies) missing in request");
            throw new ProxyAuthException(sb.toString());
        }
    }
View Full Code Here

        if (authHandler != null) {
            authHandler.doHandshake(nextFilter);
        } else {
            if (requestSent) {
                // Safety check
                throw new ProxyAuthException("Authentication request already sent");
            }

            logger.debug("  sending HTTP request");

            // Compute request headers
View Full Code Here

            }

        }

        if (authHandler == null) {
            throw new ProxyAuthException("Unknown authentication mechanism(s): " + values);
        }
    }
View Full Code Here

            if (authHandler == null) {
                autoSelectAuthHandler(response);
            }
            authHandler.handleResponse(response);
        } else {
            throw new ProxyAuthException("Error: unexpected response code " + response.getStatusLine()
                    + " received from proxy.");
        }
    }
View Full Code Here

            // 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() + ").");
        }
    }
View Full Code Here

        } catch (Exception ex) {
            if (ex instanceof ProxyAuthException) {
                throw ((ProxyAuthException) ex);
            }

            throw new ProxyAuthException("Handshake failed", ex);
        }
    }
View Full Code Here

    @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()
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException {
        if (response.getStatusCode() != 407) {
            throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ").");
        }
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException {
        // Should never get here !
        throw new ProxyAuthException("Received error response code (" + response.getStatusLine() + ").");
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.proxy.ProxyAuthException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.