Enhancing security of connection client

Correction of Reconnection scenarios and client authentication