only using ssl when needed