Should this be before the check for an encrypted socket?