Class SslRMIClientSocketFactory
- All Implemented Interfaces:
Serializable, RMIClientSocketFactory
An SslRMIClientSocketFactory
instance is used by the RMI
runtime in order to obtain client sockets for RMI calls via SSL.
This class implements RMIClientSocketFactory
over
the Secure Sockets Layer (SSL) or Transport Layer Security (TLS)
protocols.
This class creates SSL sockets using the default
SSLSocketFactory
(see SSLSocketFactory.getDefault()
). All instances of this class are
functionally equivalent. In particular, they all share the same
truststore, and the same keystore when client authentication is
required by the server. This behavior can be modified in
subclasses by overriding the createSocket(String,int)
method; in that case, equals
and hashCode
may also need to be overridden.
If the system property
javax.rmi.ssl.client.enabledCipherSuites
is specified,
the createSocket(String,int)
method will call SSLSocket.setEnabledCipherSuites(String[])
before returning the
socket. The value of this system property is a string that is a
comma-separated list of SSL/TLS cipher suites to enable.
If the system property
javax.rmi.ssl.client.enabledProtocols
is specified,
the createSocket(String,int)
method will call SSLSocket.setEnabledProtocols(String[])
before returning the
socket. The value of this system property is a string that is a
comma-separated list of SSL/TLS protocol versions to enable.
- Since:
- 1.5
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
SslRMIClientSocketFactory
public SslRMIClientSocketFactory()Creates a new
SslRMIClientSocketFactory
.
-
-
Method Details
-
createSocket
Creates an SSL socket.
If the system property
javax.rmi.ssl.client.enabledCipherSuites
is specified, this method will callSSLSocket.setEnabledCipherSuites(String[])
before returning the socket. The value of this system property is a string that is a comma-separated list of SSL/TLS cipher suites to enable.If the system property
javax.rmi.ssl.client.enabledProtocols
is specified, this method will callSSLSocket.setEnabledProtocols(String[])
before returning the socket. The value of this system property is a string that is a comma-separated list of SSL/TLS protocol versions to enable.- Specified by:
createSocket
in interfaceRMIClientSocketFactory
- Parameters:
host
- the host nameport
- the port number- Returns:
- a socket connected to the specified host and port.
- Throws:
IOException
- if an I/O error occurs during socket creation
-
equals
Indicates whether some other object is "equal to" this one.
Because all instances of this class are functionally equivalent (they all use the default
SSLSocketFactory
), this method simply returnsthis.getClass().equals(obj.getClass())
.A subclass should override this method (as well as
hashCode()
) if its instances are not all functionally equivalent. -
hashCode
-