sending correct messages to server
ssl