Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6299183

javax.rmi.ssl.SslRMIServerSocketFactory cannot be a socket factory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: security-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
      Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      I create an SSL RMI Socket factory and try to set it as the socket factory to use,
      but get a class mismatch by the compiler. The call to setSocketFactory expects an argument of type RMISocketFactory, but SslRMIServerSocketFactory does not inherit from that class.

      This is under Eclipse Version: 3.0.0. Interestingly enough, when I try to compile the class using javac, I get a message that javax.rmi.ssl does not exist.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Build the class and try to compile it.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Working compilation
      ACTUAL -
      Compile time error.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      The method setSocketFactory(RMISocketFactory) in the type RMISocketFactory is not applicable for the arguments (SslRMIServerSocketFactory)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /*
      A class to set up a socket factory for the server for RMI sockets
       */

      // Set up a secure socket factory for RMI communications
      //==============================================================================
      public class SetUpServerSocketFactory
      {
      /** Define the enabled cipher suites
      *
      */
      private static final String[] enabled_cipher_suites =
      {
      "TLS_KRB5_WITH_RC4_128_SHA",
      "TLS_KRB5_WITH_RC4_128_MD5",
      "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
      "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
      "TLS_KRB5_WITH_DES_CBC_SHA",
      "TLS_KRB5_WITH_DES_CBC_MD5"
      };

      /** Define the enabled protocols
      *
      */
      private static final String[] enabled_protocols = null;

      /** Constructor
      *
      */
      //--------------------------------------------------------------------------
      public SetUpServerSocketFactory()
      {
      // Create an RMI SSL socket factory
      try
      {
      javax.rmi.ssl.SslRMIServerSocketFactory server_socket_factory =
      new javax.rmi.ssl.SslRMIServerSocketFactory
      (
      enabled_cipher_suites, // Cipher suites
      enabled_protocols, // Protocols
      true // Require client authentication
      );

      // Set the RMI socket factory to a SSL socket factory using the certificate
      java.rmi.server.RMISocketFactory.setSocketFactory(server_socket_factory);
      }
      catch (IllegalArgumentException e)
      {
      System.out.println("Illegal argument exception trying to create SSL RMI Server socket factory");
      e.printStackTrace();
      }
      catch (java.io.IOException e)
      {
      System.out.println("I/O Exception trying to set RMI socket factory");
      e.printStackTrace();
      }
      }
      }

      ---------- END SOURCE ----------
      ###@###.### 2005-07-20 08:47:32 GMT

        Attachments

          Activity

            People

            • Assignee:
              lmalvent Luis-Miguel Alventosa (Inactive)
              Reporter:
              jssunw Jitender S (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: