refactored rejectUnauthorized option