Package org.restlet.engine.ssl
Class WrapperSslSocketFactory
java.lang.Object
javax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
org.restlet.engine.ssl.WrapperSslSocketFactory
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
ConstructorsConstructorDescriptionWrapperSslSocketFactory(DefaultSslContextFactory contextFactory, SSLSocketFactory wrappedSocketFactory) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateSocket(String host, int port) createSocket(String host, int port, InetAddress localAddress, int localPort) createSocket(InetAddress host, int port) createSocket(InetAddress host, int port, InetAddress localAddress, int localPort) createSocket(Socket s, String host, int port, boolean autoClose) Returns the parent SSL context factory.String[]String[]Returns the wrapped SSL socket factory.protected SSLSocketinitSslSocket(SSLSocket sslSocket) Initializes the SSL socket.Methods inherited from class javax.net.ssl.SSLSocketFactory
createSocket, getDefault
-
Constructor Details
-
WrapperSslSocketFactory
public WrapperSslSocketFactory(DefaultSslContextFactory contextFactory, SSLSocketFactory wrappedSocketFactory) Constructor.- Parameters:
contextFactory- The parent SSL context factory.wrappedSocketFactory- The wrapped SSL server socket factory.
-
-
Method Details
-
createSocket
- Overrides:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress host, int port, InetAddress localAddress, int localPort) throws IOException - Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
- Specified by:
createSocketin classSSLSocketFactory- Throws:
IOException
-
createSocket
- Specified by:
createSocketin classSocketFactory- Throws:
IOExceptionUnknownHostException
-
createSocket
public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException, UnknownHostException - Specified by:
createSocketin classSocketFactory- Throws:
IOExceptionUnknownHostException
-
getContextFactory
Returns the parent SSL context factory.- Returns:
- The parent SSL context factory.
-
getDefaultCipherSuites
- Specified by:
getDefaultCipherSuitesin classSSLSocketFactory
-
getSupportedCipherSuites
- Specified by:
getSupportedCipherSuitesin classSSLSocketFactory
-
getWrappedSocketFactory
Returns the wrapped SSL socket factory.- Returns:
- The wrapped SSL socket factory.
-
initSslSocket
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.
-