From 9b7d5bc93fb1fd7b85c01f4c8a677ae309f9d4eb Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 18 Jun 2015 16:22:24 -0500 Subject: Catch SSL CertificateErrors and log them Signed-off-by: Dan McGee --- mirrors/management/commands/mirrorcheck.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index 1f16a375..374643e7 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -18,6 +18,7 @@ from pytz import utc import re import socket +import ssl import subprocess import sys import time @@ -146,6 +147,10 @@ def check_mirror_url(mirror_url, location, timeout): log.is_success = False log.error = "Exception in processing HTTP request." logger.debug("failed: %s, %s", url, log.error) + except ssl.CertificateError as e: + log.is_success = False + log.error = str(e) + logger.debug("failed: %s, %s", url, log.error) except socket.timeout: log.is_success = False log.error = "Connection timed out." -- cgit v1.2.3-54-g00ecf