ssl: add check for > 0 bytes read before compare check.