Package org.apache.http.nio.reactor.ssl

Examples of org.apache.http.nio.reactor.ssl.SSLIOSession


                                super.onRequestSubmitted(request);
                                if (request instanceof EntityEnclosingRequestWrapper) {
                                    request = ((EntityEnclosingRequestWrapper)request).getOriginal();
                                }
                                if (getIOSession() instanceof SSLIOSession) {
                                    SSLIOSession sslio = (SSLIOSession)getIOSession();
                                    getIOSession().setAttribute(CXFHttpRequest.class.getName(), request);
                                    if (getIOSession().getAttribute("cxf.handshake.done") != null) {
                                        ((CXFHttpRequest)request).getOutputStream()
                                            .setSSLSession(sslio.getSSLSession());
                                    }
                                }
                            }
                        };
                    }
View Full Code Here


    public boolean isSecure() {
        return true;
    }

    public SSLIOSession layer(final IOSession iosession) {
        SSLIOSession ssliosession = new SSLIOSession(iosession, SSLMode.CLIENT, this.sslContext,
                new InternalSSLSetupHandler());
        iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        return ssliosession;
    }
View Full Code Here

     */
    protected SSLIOSession createSSLIOSession(
            final IOSession session,
            final SSLContext sslcontext,
            final SSLSetupHandler sslHandler) {
        return new SSLIOSession(session, SSLMode.CLIENT, sslcontext, sslHandler);
    }
View Full Code Here

        return super.createConnection(ssliosession);
    }

    @Override
    protected NHttpClientIOTarget createConnection(final IOSession session) {
        SSLIOSession ssliosession = createSSLIOSession(session, this.sslcontext, this.sslHandler);
        session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        NHttpClientIOTarget conn = createSSLConnection(ssliosession);
        try {
            ssliosession.initialize();
        } catch (SSLException ex) {
            this.handler.exception(conn, ex);
            ssliosession.shutdown();
        }
        return conn;
    }
View Full Code Here

     */
    protected SSLIOSession createSSLIOSession(
            final IOSession session,
            final SSLContext sslcontext,
            final SSLSetupHandler sslHandler) {
        return new SSLIOSession(session, SSLMode.SERVER, sslcontext, sslHandler);
    }
View Full Code Here

        return super.createConnection(ssliosession);
    }

    @Override
    protected NHttpServerIOTarget createConnection(final IOSession session) {
        SSLIOSession ssliosession = createSSLIOSession(session, this.sslcontext, this.sslHandler);
        session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        NHttpServerIOTarget conn = createSSLConnection(ssliosession);
        try {
            ssliosession.initialize();
        } catch (SSLException ex) {
            this.handler.exception(conn, ex);
            ssliosession.shutdown();
        }
        return conn;
    }
View Full Code Here

        return new DefaultNHttpClientConnection(session, responseFactory, allocator, params);
    }

    public NHttpClientIOTarget createConnection(final IOSession session) {
        SSLContext sslcontext = this.sslcontext != null ? this.sslcontext : getDefaultSSLContext();
        SSLIOSession ssliosession = new SSLIOSession(session, SSLMode.CLIENT, sslcontext, this.sslHandler);
        session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        NHttpClientIOTarget conn = createConnection(
                ssliosession, this.responseFactory, this.allocator, this.params);
        int timeout = HttpConnectionParams.getSoTimeout(this.params);
        conn.setSocketTimeout(timeout);
View Full Code Here

            if (conn == null) {
                conn = createConnection(session);
                session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
            }
            onConnected(conn);
            SSLIOSession ssliosession = (SSLIOSession) session.getAttribute(
                    SSLIOSession.SESSION_KEY);
            if (ssliosession != null) {
                try {
                    synchronized (ssliosession) {
                        if (!ssliosession.isInitialized()) {
                            ssliosession.initialize();
                        }
                    }
                } catch (IOException ex) {
                    onException(conn, ex);
                    ssliosession.shutdown();
                }
            }
        } catch (RuntimeException ex) {
            session.shutdown();
            throw ex;
View Full Code Here

    public void inputReady(final IOSession session) {
        @SuppressWarnings("unchecked")
        T conn = (T) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
        try {
            ensureNotNull(conn);
            SSLIOSession ssliosession = (SSLIOSession) session.getAttribute(
                    SSLIOSession.SESSION_KEY);
            if (ssliosession == null) {
                onInputReady(conn);
            } else {
                try {
                    if (!ssliosession.isInitialized()) {
                        ssliosession.initialize();
                    }
                    if (ssliosession.isAppInputReady()) {
                        onInputReady(conn);
                    }
                    ssliosession.inboundTransport();
                } catch (IOException ex) {
                    onException(conn, ex);
                    ssliosession.shutdown();
                }
            }
        } catch (RuntimeException ex) {
            session.shutdown();
            throw ex;
View Full Code Here

    public void outputReady(final IOSession session) {
        @SuppressWarnings("unchecked")
        T conn = (T) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
        try {
            ensureNotNull(conn);
            SSLIOSession ssliosession = (SSLIOSession) session.getAttribute(
                    SSLIOSession.SESSION_KEY);
            if (ssliosession == null) {
                onOutputReady(conn);
            } else {
                try {
                    if (!ssliosession.isInitialized()) {
                        ssliosession.initialize();
                    }
                    if (ssliosession.isAppOutputReady()) {
                        onOutputReady(conn);
                    }
                    ssliosession.outboundTransport();
                } catch (IOException ex) {
                    onException(conn, ex);
                    ssliosession.shutdown();
                }
            }
        } catch (RuntimeException ex) {
            session.shutdown();
            throw ex;
View Full Code Here

TOP

Related Classes of org.apache.http.nio.reactor.ssl.SSLIOSession

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.