I'm implementing an application that creates SSH connections and port forwards in those connections. A use case is that exactly the same connection; same host, same port, same forwards is requested again at a later point in time. Researching this, I found the multiplex protocol implemented in SSH. When testing this with a local OpenSSH binary everything works as expected, I see the socket file (ControlPath option) being created and the connection is being reused.
I was looking for a Java implementation of this process but it seems none of the existing libraries work as I expect. I've tried Jsch, sshj, mina-sshd, ..
Only by using the processbuilder and actually using a OpenSSH binary, I see the socket file being created and the connection being reused across JVM shutdowns. Have I made programming mistake or is it just not possible? The only project actually stating to support this feature is sshj, but when testing I didn't see any socket files being created..
Do these pure Java implementations just work differently? Don't they create these socket files? Has anyone have any experience at all trying to make this work and can you point me in a direction?