First working version (handshake, changecipherspec and record layer