I have a custom RMIClientSocketFactory which override "createSocket" to create a special socket.
How can i get hold of this socket in my rmi remote interface implementation? (the one that extends UnicastRemoteObject and implements interface that extends Remote)
I know that this isn't standard, but i wish to get the ssl certificate used by rmi in a rmi function.
You can't. You're in the server, and the socket created in your RMIClientSocketFactory
is in the client. That part of the question doesn't make sense.
You can however get hold of the socket created at your end by your RMIServerSocketFactory.
It's a little fiddly, as you have to arrange to register the accepted sockets in a ThreadLocal
, but it's doable.