Search in sources :

Example 6 with SSLIOSession

use of org.apache.http.nio.reactor.ssl.SSLIOSession in project wso2-synapse by wso2.

the class ServerConnFactory method createConnection.

public DefaultNHttpServerConnection createConnection(final IOSession iosession) {
    SSLContextDetails customSSL = null;
    if (sslByIPMap != null) {
        customSSL = sslByIPMap.get(iosession.getLocalAddress());
    }
    if (customSSL == null) {
        customSSL = ssl;
    }
    IOSession customSession;
    if (customSSL != null) {
        customSession = new SSLIOSession(iosession, SSLMode.SERVER, customSSL.getContext(), customSSL.getHandler());
        iosession.setAttribute(SSLIOSession.SESSION_KEY, customSession);
    } else {
        customSession = iosession;
    }
    DefaultNHttpServerConnection conn = LoggingUtils.createServerConnection(customSession, requestFactory, allocator, params);
    int timeout = HttpConnectionParams.getSoTimeout(params);
    conn.setSocketTimeout(timeout);
    return conn;
}
Also used : SSLIOSession(org.apache.http.nio.reactor.ssl.SSLIOSession) SSLIOSession(org.apache.http.nio.reactor.ssl.SSLIOSession) IOSession(org.apache.http.nio.reactor.IOSession) DefaultNHttpServerConnection(org.apache.http.impl.nio.DefaultNHttpServerConnection)

Aggregations

SSLIOSession (org.apache.http.nio.reactor.ssl.SSLIOSession)6 IOSession (org.apache.http.nio.reactor.IOSession)4 SSLContext (javax.net.ssl.SSLContext)3 InetAddress (java.net.InetAddress)2 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)2 MessageContext (org.apache.axis2.context.MessageContext)2 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)1 MultiValueMap (org.apache.commons.collections.map.MultiValueMap)1 HttpInetConnection (org.apache.http.HttpInetConnection)1 DefaultNHttpClientConnection (org.apache.http.impl.nio.DefaultNHttpClientConnection)1 DefaultNHttpServerConnection (org.apache.http.impl.nio.DefaultNHttpServerConnection)1 NHttpServerConnection (org.apache.http.nio.NHttpServerConnection)1 HttpContext (org.apache.http.protocol.HttpContext)1 HttpCoreRequestResponseTransport (org.apache.synapse.transport.nhttp.HttpCoreRequestResponseTransport)1