Fix SSL handshake and IO (blocking and non blocking, sendfile).