public class

SslRMIClientSocketFactory

extends Object
implements Serializable RMIClientSocketFactory
java.lang.Object
   ↳ javax.rmi.ssl.SslRMIClientSocketFactory

Class Overview

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 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 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 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.

Summary

Public Constructors
SslRMIClientSocketFactory()

Creates a new SslRMIClientSocketFactory.

Public Methods
Socket createSocket(String host, int port)

Creates an SSL socket.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

int hashCode()

Returns a hash code value for this SslRMIClientSocketFactory.

[Expand]
Inherited Methods
From class java.lang.Object
From interface java.rmi.server.RMIClientSocketFactory

Public Constructors

public SslRMIClientSocketFactory ()

Creates a new SslRMIClientSocketFactory.

Public Methods

public Socket createSocket (String host, int port)

Creates an SSL socket.

If the system property javax.rmi.ssl.client.enabledCipherSuites is specified, this method will call 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 call 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.

Parameters
host the host name
port the port number
Returns
  • a socket connected to the specified host and port.
Throws
IOException

public boolean equals (Object obj)

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 returns this.getClass().equals(obj.getClass()).

A subclass should override this method (as well as hashCode()) if its instances are not all functionally equivalent.

Parameters
obj the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public int hashCode ()

Returns a hash code value for this SslRMIClientSocketFactory.

Returns
  • a hash code value for this SslRMIClientSocketFactory.