Fix with SSL channels when determining wether to return -1