RMI, SSL (secure) Custom Sockets and UnicastServerRef2
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dan_phung
Posted On:   Thursday, August 8, 2002 08:17 PM

Hi, I am having a problem using SSL sockets with the RMIClassLoader. I'm using an implementation of SSL Sockets, which I'm setting within the RMI implementation by using: RMISocketFactory.setSocketFactory I also have an implementation of a ClassServer which is also using secure sockets. I set my codebase to that socket, sot hen I invoke method using the stub I have (after I've done a lookup to the server) it will try to load the class through that socket. my problem is that the anonymous port created when the stub is used is using non-secure sockets, so I get a ssl handshaking error. If I use a plain socket in my class server it works fine. I was t   More>>

Hi, I am having a problem using SSL sockets with the RMIClassLoader.


I'm using an implementation of SSL Sockets, which I'm setting within the RMI implementation by using: RMISocketFactory.setSocketFactory


I also have an implementation of a ClassServer which is also using secure sockets. I set my codebase to that socket, sot hen I invoke method using the stub I have (after I've done a lookup to the server) it will try to load the class through that socket.


my problem is that the anonymous port created when the stub
is used is using non-secure sockets, so I get a ssl handshaking error. If I use a plain socket in my class server it works fine.


I was trying to research this problem and found that if using custom sockets, the remote object should be exporting through a UnicastServerRef2, instead of the UnicastServerRef for default sockets. So in addition to RMISocketFactory.setSocketFactory , I also use the UnicastRemoteObject contstructor that specifies the custom socket, but to no avail!!!

can anybody help???


thanks in advance,

dan

   <<Less

Re: RMI, SSL (secure) Custom Sockets and UnicastServerRef2

Posted By:   dan_phung  
Posted On:   Tuesday, August 13, 2002 04:38 PM

figured it out! so if anyone is trying to use RMI and have it load classes from an https site, the remote site needs to
implement it's own version of RMIClassLoaderSpi. In the loadClass method use can specify your own loader using secure sockets. also, don't forget to set the system property "java.rmi.server.RMIClassLoaderSpi=YourRMICLassLoaderSpi".


I did this, and it worked like jiffy!!! good luck!

About | Sitemap | Contact