Package org.restlet.engine.ssl
Class WrapperSslSocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- javax.net.ssl.SSLSocketFactory
-
- org.restlet.engine.ssl.WrapperSslSocketFactory
-
public class WrapperSslSocketFactory extends javax.net.ssl.SSLSocketFactorySSL socket factory that wraps the default one to do extra initialization. Configures the cipher suites and the SSL certificate request.
-
-
Field Summary
Fields Modifier and Type Field Description private DefaultSslContextFactorycontextFactoryThe parent SSL context factory.private javax.net.ssl.SSLSocketFactorywrappedSocketFactoryThe wrapped SSL server socket factory.
-
Constructor Summary
Constructors Constructor Description WrapperSslSocketFactory(DefaultSslContextFactory contextFactory, javax.net.ssl.SSLSocketFactory wrappedSocketFactory)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.SocketcreateSocket()java.net.SocketcreateSocket(java.lang.String host, int port)java.net.SocketcreateSocket(java.lang.String host, int port, java.net.InetAddress localAddress, int localPort)java.net.SocketcreateSocket(java.net.InetAddress host, int port)java.net.SocketcreateSocket(java.net.InetAddress host, int port, java.net.InetAddress localAddress, int localPort)java.net.SocketcreateSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose)DefaultSslContextFactorygetContextFactory()Returns the parent SSL context factory.java.lang.String[]getDefaultCipherSuites()java.lang.String[]getSupportedCipherSuites()javax.net.ssl.SSLSocketFactorygetWrappedSocketFactory()Returns the wrapped SSL socket factory.protected javax.net.ssl.SSLSocketinitSslSocket(javax.net.ssl.SSLSocket sslSocket)Initializes the SSL socket.
-
-
-
Field Detail
-
contextFactory
private final DefaultSslContextFactory contextFactory
The parent SSL context factory.
-
wrappedSocketFactory
private final javax.net.ssl.SSLSocketFactory wrappedSocketFactory
The wrapped SSL server socket factory.
-
-
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:
createSocketin classjavax.net.SocketFactory- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.net.InetAddress host, int port) throws java.io.IOException- Specified by:
createSocketin classjavax.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:
createSocketin classjavax.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:
createSocketin classjavax.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:
createSocketin classjavax.net.SocketFactory- Throws:
java.io.IOExceptionjava.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:
createSocketin classjavax.net.SocketFactory- Throws:
java.io.IOExceptionjava.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:
getDefaultCipherSuitesin classjavax.net.ssl.SSLSocketFactory
-
getSupportedCipherSuites
public java.lang.String[] getSupportedCipherSuites()
- Specified by:
getSupportedCipherSuitesin classjavax.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.
-
-