summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2015-06-18 16:22:24 -0500
committerDan McGee <dan@archlinux.org>2015-06-18 16:22:24 -0500
commit9b7d5bc93fb1fd7b85c01f4c8a677ae309f9d4eb (patch)
treee79fe80f9eb57ce25f05e724cb067dbc0b8d70d8
parentb28b46befab52548968a19c068ad5108adaa84a8 (diff)
Catch SSL CertificateErrors and log them
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--mirrors/management/commands/mirrorcheck.py5
1 files changed, 5 insertions, 0 deletions
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 optparse import make_option
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."