handle ssl errors