Class SslRMIServerSocketFactory
- All Implemented Interfaces:
RMIServerSocketFactory
An SslRMIServerSocketFactory instance is used by the RMI
runtime in order to obtain server sockets for RMI calls via SSL.
This class implements RMIServerSocketFactory over
the Secure Sockets Layer (SSL) or Transport Layer Security (TLS)
protocols.
This class creates SSL sockets using the default
SSLSocketFactory (see SSLSocketFactory.getDefault()) or the default
SSLServerSocketFactory (see SSLServerSocketFactory.getDefault()) unless the
constructor taking an SSLContext is
used in which case the SSL sockets are created using
the SSLSocketFactory returned by
SSLContext.getSocketFactory() or the
SSLServerSocketFactory returned by
SSLContext.getServerSocketFactory().
When an SSLContext is not supplied all the instances of this
class share the same keystore, and the same truststore (when client
authentication is required by the server). This behavior can be modified
by supplying an already initialized SSLContext instance.
- Since:
- 1.5
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newSslRMIServerSocketFactorywith the default SSL socket configuration.SslRMIServerSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) Creates a newSslRMIServerSocketFactorywith the specified SSL socket configuration.SslRMIServerSocketFactory(SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) Creates a newSslRMIServerSocketFactorywith the specifiedSSLContextand SSL socket configuration. -
Method Summary
Modifier and TypeMethodDescriptioncreateServerSocket(int port) Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.booleanIndicates whether some other object is "equal to" this one.final String[]Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, ornullif this factory uses the cipher suites that are enabled by default.final String[]Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, ornullif this factory uses the protocol versions that are enabled by default.final booleanReturnstrueif client authentication is required on SSL connections accepted by server sockets created by this factory.inthashCode()Returns a hash code value for thisSslRMIServerSocketFactory.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
SslRMIServerSocketFactory
public SslRMIServerSocketFactory()Creates a new
SslRMIServerSocketFactorywith the default SSL socket configuration.SSL connections accepted by server sockets created by this factory have the default cipher suites and protocol versions enabled and do not require client authentication.
-
SslRMIServerSocketFactory
public SslRMIServerSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) throws IllegalArgumentException Creates a new
SslRMIServerSocketFactorywith the specified SSL socket configuration.- Parameters:
enabledCipherSuites- names of all the cipher suites to enable on SSL connections accepted by server sockets created by this factory, ornullto use the cipher suites that are enabled by defaultenabledProtocols- names of all the protocol versions to enable on SSL connections accepted by server sockets created by this factory, ornullto use the protocol versions that are enabled by defaultneedClientAuth-trueto require client authentication on SSL connections accepted by server sockets created by this factory;falseto not require client authentication- Throws:
IllegalArgumentException- when one or more of the cipher suites named by theenabledCipherSuitesparameter is not supported, when one or more of the protocols named by theenabledProtocolsparameter is not supported or when a problem is encountered while trying to check if the supplied cipher suites and protocols to be enabled are supported.- See Also:
-
SslRMIServerSocketFactory
public SslRMIServerSocketFactory(SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) throws IllegalArgumentException Creates a new
SslRMIServerSocketFactorywith the specifiedSSLContextand SSL socket configuration.- Parameters:
context- the SSL context to be used for creating SSL sockets. Ifcontextis null the defaultSSLSocketFactoryor the defaultSSLServerSocketFactorywill be used to create SSL sockets. Otherwise, the socket factory returned bySSLContext.getSocketFactory()orSSLContext.getServerSocketFactory()will be used instead.enabledCipherSuites- names of all the cipher suites to enable on SSL connections accepted by server sockets created by this factory, ornullto use the cipher suites that are enabled by defaultenabledProtocols- names of all the protocol versions to enable on SSL connections accepted by server sockets created by this factory, ornullto use the protocol versions that are enabled by defaultneedClientAuth-trueto require client authentication on SSL connections accepted by server sockets created by this factory;falseto not require client authentication- Throws:
IllegalArgumentException- when one or more of the cipher suites named by theenabledCipherSuitesparameter is not supported, when one or more of the protocols named by theenabledProtocolsparameter is not supported or when a problem is encountered while trying to check if the supplied cipher suites and protocols to be enabled are supported.- Since:
- 1.7
- See Also:
-
-
Method Details
-
getEnabledCipherSuites
Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, or
nullif this factory uses the cipher suites that are enabled by default.- Returns:
- an array of cipher suites enabled, or
null - See Also:
-
getEnabledProtocols
Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, or
nullif this factory uses the protocol versions that are enabled by default.- Returns:
- an array of protocol versions enabled, or
null - See Also:
-
getNeedClientAuth
public final boolean getNeedClientAuth()Returns
trueif client authentication is required on SSL connections accepted by server sockets created by this factory.- Returns:
trueif client authentication is required- See Also:
-
createServerSocket
Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.
- Specified by:
createServerSocketin interfaceRMIServerSocketFactory- Parameters:
port- the port number- Returns:
- the server socket on the specified port
- Throws:
IOException- if an I/O error occurs during server socket creation
-
equals
Indicates whether some other object is "equal to" this one.
Two
SslRMIServerSocketFactoryobjects are equal if they have been constructed with the same SSL context and SSL socket configuration parameters.A subclass should override this method (as well as
hashCode()) if it adds instance state that affects equality. -
hashCode
-