users@glassfish.java.net

Re: Help: SSL + IIOP Listener not working for EJB standalone client, why?

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 Jan 2009 09:16:35 PST

NVM, I figured it out.

I should have my lookup do this

Properties props = new Properties();

props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs",
"com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state",
"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");

props.setProperty("org.omg.CORBA.ORBInitialHost",
"myserver");
[b]System.setProperty("javax.net.ssl.trustStore",
                                "C:\\location\\to\\my\\trusted\\certificates\\cacerts.jks");[/b]
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");

InitialContext ctx = new InitialContext(props);

return (SomeServiceRemote) ctx
.lookup("ejb/some/stateless/SomeServiceBean.v1.0.1");

It is obvious that I need to tell the system the trusted certificates so that it can use the public key to ecrypt message back to the server for a proper handshake...or something along those lines. I'm pretty new on how SSL is suppose to work. I just had to realize what was missing between my client and a web browser. Thank god I know a little bit of what I am doing or else my question would have never been answered and I would have given up on this.
[Message sent by forum member 'vsgster' (vsgster)]

http://forums.java.net/jive/thread.jspa?messageID=326520