Switching between SSL and non SSL mode using custom RMI socket factory
posted 12 years ago
I've implemented custom RMI socket factory which uses SSL sockets instead of plain ones. All works fine. But how can I switch between SSL and non SSL mode dynamically? RMISocketFactory can be initialized only once using static method setSocketFactory(RMISocketFactory factory). I try to set flag which enables/disables SSL mode and use proper sockets in each case according to flag value. But this approach produces such issues as: 1. Client need to switch its own SSL mode flag at the same time (may be with help of RMI callbacks or some other?) 2. RMISocketFactory tries to use already existing SSL sockets(where it possible) and there is no way to release them somehow and to force RMISocketFactory to use new plain sockets instead of SSL sockets. May be there is another way to do this?