com.nativex.advertiser
Class EasySSLSocketFactory

java.lang.Object
  extended by org.apache.http.conn.ssl.SSLSocketFactory
      extended by com.nativex.advertiser.EasySSLSocketFactory
All Implemented Interfaces:
LayeredSocketFactory, SocketFactory

public class EasySSLSocketFactory
extends SSLSocketFactory

Handles the SSL connection.

Author:
matthew.macgregor

Field Summary
private  SSLContext sslContext
           
 
Fields inherited from class org.apache.http.conn.ssl.SSLSocketFactory
ALLOW_ALL_HOSTNAME_VERIFIER, BROWSER_COMPATIBLE_HOSTNAME_VERIFIER, SSL, SSLV2, STRICT_HOSTNAME_VERIFIER, TLS
 
Constructor Summary
EasySSLSocketFactory(KeyStore truststore)
          Creates a custom SSLSocket factory to handle connections to https.
 
Method Summary
 Socket createSocket()
           
 Socket createSocket(Socket socket, String host, int port, boolean autoClose)
          Creates an ssl socket using the underlying SSLContext.
 
Methods inherited from class org.apache.http.conn.ssl.SSLSocketFactory
connectSocket, getHostnameVerifier, getSocketFactory, isSecure, setHostnameVerifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sslContext

private SSLContext sslContext
Constructor Detail

EasySSLSocketFactory

public EasySSLSocketFactory(KeyStore truststore)
                     throws NoSuchAlgorithmException,
                            KeyManagementException,
                            KeyStoreException,
                            UnrecoverableKeyException
Creates a custom SSLSocket factory to handle connections to https.

Throws:
NoSuchAlgorithmException
KeyManagementException
KeyStoreException
UnrecoverableKeyException
Method Detail

createSocket

public Socket createSocket(Socket socket,
                           String host,
                           int port,
                           boolean autoClose)
                    throws IOException,
                           UnknownHostException
Creates an ssl socket using the underlying SSLContext.

Specified by:
createSocket in interface LayeredSocketFactory
Overrides:
createSocket in class SSLSocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket()
                    throws IOException
Specified by:
createSocket in interface SocketFactory
Overrides:
createSocket in class SSLSocketFactory
Throws:
IOException