Added try except to catch ssl exceptions