The TLS code in C2S was not updated to access the socket through the connection

The code was accessing socket.encrypted instead of connection.isSecure and setSecure instead of connection.setSecure.