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

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


    public void timeout(final IOSession session) {
        @SuppressWarnings("unchecked")
        T conn = (T) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
        try {
            SSLIOSession ssliosession = (SSLIOSession) session.getAttribute(
                    SSLIOSession.SESSION_KEY);
            ensureNotNull(conn);
            onTimeout(conn);
            if (ssliosession != null) {
                synchronized (ssliosession) {
                    if (ssliosession.isOutboundDone() && !ssliosession.isInboundDone()) {
                        // The session failed to terminate cleanly
                        ssliosession.shutdown();
                    }
                }
            }
        } catch (RuntimeException ex) {
            session.shutdown();
View Full Code Here


        return new DefaultNHttpServerConnection(session, requestFactory, allocator, params);
    }

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

                                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

                                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

    }

    @Override
    public DefaultNHttpClientConnection createConnection(final IOSession iosession) {
        if (this.sslcontext != null) {
            final SSLIOSession ssliosession = new SSLIOSession(
                    iosession, SSLMode.CLIENT, this.sslcontext, this.setupHandler);
            iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
            return new LoggingNHttpClientConnection(ssliosession);
        } else {
            return new LoggingNHttpClientConnection(iosession);
View Full Code Here

    }

    @Override
    public DefaultNHttpServerConnection createConnection(final IOSession iosession) {
        if (this.sslcontext != null) {
            final SSLIOSession ssliosession = new SSLIOSession(
                    iosession, SSLMode.SERVER, this.sslcontext, this.setupHandler);
            iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
            return new LoggingNHttpServerConnection(ssliosession);
        } else {
            return new LoggingNHttpServerConnection(iosession);
View Full Code Here

     */
    protected SSLIOSession createSSLIOSession(
            final IOSession iosession,
            final SSLContext sslcontext,
            final SSLSetupHandler sslHandler) {
        final SSLIOSession ssliosession = new SSLIOSession(iosession, SSLMode.SERVER,
                (sslcontext != null ? sslcontext : SSLContextUtils.getDefault()),
                sslHandler);
        return ssliosession;
    }
View Full Code Here

        return ssliosession;
    }

    @Override
    public DefaultNHttpServerConnection createConnection(final IOSession iosession) {
        final SSLIOSession ssliosession = createSSLIOSession(iosession, this.sslcontext, this.sslHandler);
        iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        return new DefaultNHttpServerConnection(ssliosession,
                this.cconfig.getBufferSize(),
                this.cconfig.getFragmentSizeHint(),
                this.allocator,
View Full Code Here

     */
    protected SSLIOSession createSSLIOSession(
            final IOSession iosession,
            final SSLContext sslcontext,
            final SSLSetupHandler sslHandler) {
        final SSLIOSession ssliosession = new SSLIOSession(iosession, SSLMode.CLIENT,
                (sslcontext != null ? sslcontext : SSLContextUtils.getDefault()),
                sslHandler);
        return ssliosession;
    }
View Full Code Here

        return ssliosession;
    }

    @Override
    public DefaultNHttpClientConnection createConnection(final IOSession iosession) {
        final SSLIOSession ssliosession = createSSLIOSession(iosession, this.sslcontext, this.sslHandler);
        iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        return new DefaultNHttpClientConnection(
                ssliosession,
                this.cconfig.getBufferSize(),
                this.cconfig.getFragmentSizeHint(),
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.