Restlet Framework 2.2.1
Java Standard Edition

org.restlet.engine.ssl
Class WrapperSslSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by org.restlet.engine.ssl.WrapperSslSocketFactory

public class WrapperSslSocketFactory
extends SSLSocketFactory

SSL socket factory that wraps the default one to do extra initialization. Configures the cipher suites and the SSL certificate request.

Author:
Jerome Louvel

Constructor Summary
WrapperSslSocketFactory(DefaultSslContextFactory contextFactory, SSLSocketFactory wrappedSocketFactory)
          Constructor.
 
Method Summary
 Socket createSocket()
           
 Socket createSocket(InetAddress host, int port)
           
 Socket createSocket(InetAddress host, int port, InetAddress localAddress, int localPort)
           
 Socket createSocket(Socket s, String host, int port, boolean autoClose)
           
 Socket createSocket(String host, int port)
           
 Socket createSocket(String host, int port, InetAddress localAddress, int localPort)
           
 DefaultSslContextFactory getContextFactory()
          Returns the parent SSL context factory.
 String[] getDefaultCipherSuites()
           
 String[] getSupportedCipherSuites()
           
 SSLSocketFactory getWrappedSocketFactory()
          Returns the wrapped SSL socket factory.
protected  SSLSocket initSslSocket(SSLSocket sslSocket)
          Initializes the SSL socket.
 
Methods inherited from class javax.net.ssl.SSLSocketFactory
getDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapperSslSocketFactory

public WrapperSslSocketFactory(DefaultSslContextFactory contextFactory,
                               SSLSocketFactory wrappedSocketFactory)
Constructor.

Parameters:
contextFactory - The parent SSL context factory.
wrappedSocketFactory - The wrapped SSL server socket factory.
Method Detail

createSocket

public Socket createSocket()
                    throws IOException
Overrides:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(InetAddress host,
                           int port)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(InetAddress host,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(Socket s,
                           String host,
                           int port,
                           boolean autoClose)
                    throws IOException
Specified by:
createSocket in class SSLSocketFactory
Throws:
IOException

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(String host,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

getContextFactory

public DefaultSslContextFactory getContextFactory()
Returns the parent SSL context factory.

Returns:
The parent SSL context factory.

getDefaultCipherSuites

public String[] getDefaultCipherSuites()
Specified by:
getDefaultCipherSuites in class SSLSocketFactory

getSupportedCipherSuites

public String[] getSupportedCipherSuites()
Specified by:
getSupportedCipherSuites in class SSLSocketFactory

getWrappedSocketFactory

public SSLSocketFactory getWrappedSocketFactory()
Returns the wrapped SSL socket factory.

Returns:
The wrapped SSL socket factory.

initSslSocket

protected SSLSocket initSslSocket(SSLSocket sslSocket)
Initializes the SSL socket. Configures the certificate request (need or want) and the enabled cipher suites.

Parameters:
sslSocket - The socket to initialize.
Returns:
The initialized socket.

Restlet Framework 2.2.1
Java Standard Edition

Copyright © 2005-2014 Restlet.