Restlet Framework 2.2.3
Android

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 javax.net.ssl.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, javax.net.ssl.SSLSocketFactory wrappedSocketFactory)
          Constructor.
 
Method Summary
 java.net.Socket createSocket()
           
 java.net.Socket createSocket(java.net.InetAddress host, int port)
           
 java.net.Socket createSocket(java.net.InetAddress host, int port, java.net.InetAddress localAddress, int localPort)
           
 java.net.Socket createSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose)
           
 java.net.Socket createSocket(java.lang.String host, int port)
           
 java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localAddress, int localPort)
           
 DefaultSslContextFactory getContextFactory()
          Returns the parent SSL context factory.
 java.lang.String[] getDefaultCipherSuites()
           
 java.lang.String[] getSupportedCipherSuites()
           
 javax.net.ssl.SSLSocketFactory getWrappedSocketFactory()
          Returns the wrapped SSL socket factory.
protected  javax.net.ssl.SSLSocket initSslSocket(javax.net.ssl.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,
                               javax.net.ssl.SSLSocketFactory wrappedSocketFactory)
Constructor.

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

createSocket

public java.net.Socket createSocket()
                             throws java.io.IOException
Overrides:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.InetAddress host,
                                    int port)
                             throws java.io.IOException
Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

createSocket

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

createSocket

public java.net.Socket createSocket(java.net.Socket s,
                                    java.lang.String host,
                                    int port,
                                    boolean autoClose)
                             throws java.io.IOException
Specified by:
createSocket in class javax.net.ssl.SSLSocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException
java.net.UnknownHostException

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress localAddress,
                                    int localPort)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException
java.net.UnknownHostException

getContextFactory

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

Returns:
The parent SSL context factory.

getDefaultCipherSuites

public java.lang.String[] getDefaultCipherSuites()
Specified by:
getDefaultCipherSuites in class javax.net.ssl.SSLSocketFactory

getSupportedCipherSuites

public java.lang.String[] getSupportedCipherSuites()
Specified by:
getSupportedCipherSuites in class javax.net.ssl.SSLSocketFactory

getWrappedSocketFactory

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

Returns:
The wrapped SSL socket factory.

initSslSocket

protected javax.net.ssl.SSLSocket initSslSocket(javax.net.ssl.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.3
Android

Copyright © 2005-2014 Restlet.