commit:     92d682ca0f8d173149df8511a06b0457ffbffa8d
Author:     Daniel Harding <dharding <AT> living180 <DOT> net>
AuthorDate: Sat Sep  2 11:13:00 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 13 05:50:12 2019 +0000
URL:        https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=92d682ca

selectors.py: handle ssl.CertificateError (bug 604968)

Bug: https://bugs.gentoo.org/604968
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 mirrorselect/selectors.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py
index cf70b21..58a44a1 100644
--- a/mirrorselect/selectors.py
+++ b/mirrorselect/selectors.py
@@ -31,6 +31,7 @@ Distributed under the terms of the GNU General Public License 
v2
 import math
 import signal
 import socket
+import ssl
 import subprocess
 import sys
 import time
@@ -430,7 +431,7 @@ class Deep(object):
                        if len(ips) == 1:
                                test_url = url_unparse(url_parts)
                                return self._test_connection(test_url, 
url_parts, ip, [])
-               except EnvironmentError as e:
+               except (EnvironmentError, ssl.CertificateError) as e:
                        self.output.write('deeptime(): connection to host %s '
                                'failed for ip %s:\n            %s\n'
                                % (url_parts.hostname, ip, e), 2)

Reply via email to