1 2 Previous Next 17 Replies Latest reply: Feb 21, 2012 3:33 AM by 918782 Go to original post RSS
      • 15. Re: How to implement RMI-IIOP over SSL?
        918782
        the on-legacy package doesn't declare the API getEndPointInfo, according to the interface you pasted, it should be the one as following:
        com.sun.corba.se.spi.legacy.connection.ORBSocketFactory

        If we don't tell the IOR the SSL info, how did client communicate with ORB with SSL mode after the interface is looked up from orbd, and narrowed?

        I wrote a MySSLSocketFactory and passed it to ORB, it do listen the port both on 50001 and 500002.

        +//init ORB+
        Properties p = System.getProperties();
        +     Properties clonedProperties = (Properties)p.clone();+
        +     clonedProperties.put("com.sun.CORBA.transport.ORBSocketFactoryClass",+
        +     "MySSLSocketFactory");+
        +     clonedProperties.put("com.sun.CORBA.transport.ORBListenSocket",+
        +"SSL:50002,NORMAL:50001");+
        +     +
        ORB customOrb = ORB.init((String[])null, clonedProperties);

        +//Naming context with ORB+
        Hashtable environment = new Hashtable();
        +     environment.put("java.naming.factory.initial",+
        +     "com.sun.jndi.cosnaming.CNCtxFactory");+
        +     environment.put("java.naming.provider.url", "iiop://" + hostname + ":"+
        +     + portId);+
        +     environment.put("java.naming.corba.orb", customOrb);+

        +     // Setup naming context+
        +     Context namingContext = new InitialContext(environment);+

        HelloImpl helloRef = new HelloImpl();
        initialNamingContext.rebind("HelloService", helloRef );


        But the client still communicate with other port, say non-SSL port.

        Properties p = System.getProperties();
        +     Properties clonedProperties = (Properties)p.clone();+
        +     clonedProperties.put("com.sun.CORBA.transport.ORBSocketFactoryClass",+
        +     "MySSLSocketFactory");+
        +     clonedProperties.put("com.sun.CORBA.transport.ORBListenSocket",+
        +"SSL:50002,NORMAL:50001");+
        +     +

        +     ORB customOrb = ORB.init((String[])null, clonedProperties);+
        +     +
        +          Hashtable environment = new Hashtable();+
        +     environment.put("java.naming.factory.initial",+
        +     "com.sun.jndi.cosnaming.CNCtxFactory");+
        +     environment.put("java.naming.provider.url", "iiop://" + hostname + ":"+
        +     + portId);+
        +     environment.put("java.naming.corba.orb", customOrb);+

        +     // Setup naming context+
        +     Context ic= new InitialContext(environment);+

        objref = ic.lookup("HelloService");
        hi = (Hello) PortableRemoteObject.narrow(
        objref, Hello.class);
        String t = hi.sayHello( " MARS " );

        I use WireShark to snap the package, the protocols is still GIOP.

        Need help!

        could you please shed some light on this ?

        Edited by: user3581325 on Feb 21, 2012 1:12 AM

        Edited by: user3581325 on Feb 21, 2012 1:19 AM
        • 16. Re: How to implement RMI-IIOP over SSL?
          EJP
          I can only provide limited help on this because I've researched it for JDK 1.4 and 1.5 but never done it.

          The page on PortableInterceptors is here.
          • 17. Re: How to implement RMI-IIOP over SSL?
            918782
            Caused by my poor knowlege of CORBA ...

            Now I downloaded a source code of JacORB, a free ORB product.

            I need to debug the code of JacORB, and implemented by ourselves ...

            thanks you a lot anyway.
            1 2 Previous Next