Fix "writable" and "readable" state in TLS sockets to prevent an
assertion error in HTTP code.