Yes, just like you said already in the question:
An RMIClientSocketFactory must be serializable, and will be serialized to the client other side, when used with exportObject
or UnicastRemoteObject's constructor.
This means that it must not contain (non-transient) references to objects which are non-serializable, only the necessary information to create a socket on the fly.
(I recently posted an example for a RMISocketFactory, where I needed to take care to be serializable.)
Edit (after the comment from EJP):
Of course, this only applies if you need to use a client socket factory at all. In many circumstances, you simply can use the other exportObject
methods (or other constructors), which then use the default server socket factory on the server side, and the default client socket factory at the client side, without serializing anything.
And yes, there is no point of serializing the server's trust store to the client - if the client has to trust the registry or other remote objects for which certificates to accept, we have the point for a man-in-the-middle attack. Thus SslRMIClientSocketFactory, while being Serializable, does not serialize the server's SSL context, but simply uses the client VM's SSL settings.