Class SslRMIClientSocketFactory

java.lang.Object
javax.rmi.ssl.SslRMIClientSocketFactory
All Implemented Interfaces:
Serializable, RMIClientSocketFactory

public class SslRMIClientSocketFactory extends Object implements RMIClientSocketFactory, Serializable

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
    Constructor
    Description
    Creates a new SslRMIClientSocketFactory.
  • Method Summary

    Modifier and Type
    Method
    Description
    createSocket(String host, int port)
    Creates an SSL socket.
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this SslRMIClientSocketFactory.

    Methods declared in class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    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 void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    Answers a string containing a concise, human-readable description of the receiver.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(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 by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(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 by notify or notifyAll) or the expiration of the timeout.
  • Constructor Details

    • SslRMIClientSocketFactory

      public SslRMIClientSocketFactory()

      Creates a new SslRMIClientSocketFactory.

  • Method Details

    • createSocket

      public Socket createSocket(String host, int port) throws IOException

      Creates an SSL socket.

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

      Specified by:
      createSocket in interface RMIClientSocketFactory
      Parameters:
      host - the host name
      port - 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

      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.

      Overrides:
      equals in class Object
      Parameters:
      obj - Object the object to compare with this object.
      Returns:
      boolean true if the object is the same as this object false if it is different from this object.
      See Also:
    • hashCode

      public int hashCode()

      Returns a hash code value for this SslRMIClientSocketFactory.

      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this SslRMIClientSocketFactory.
      See Also: