Improve SSL-related version warnings.

This commit is contained in:
Valentin Lorentz 2016-02-24 17:25:51 +01:00
parent e1a86665ae
commit f1390b1aec
2 changed files with 18 additions and 11 deletions

View File

@ -33,11 +33,14 @@
import os
import sys
import time
import warnings
import datetime
import tempfile
import subprocess
from math import ceil
warnings.filterwarnings('always', category=DeprecationWarning)
debug = '--debug' in sys.argv
path = os.path.dirname(__file__)
@ -237,13 +240,18 @@ setup(
)
if sys.version_info < (2, 7, 9):
sys.stderr.write('+-----------------------------------------------------+\n')
sys.stderr.write('| Running Limnoria on Python versions older than |\n')
sys.stderr.write('| 2.7.9 is deprecated. |\n')
sys.stderr.write('| Please consider upgrading to Python 3.4 or greater. |\n')
sys.stderr.write('+-----------------------------------------------------+\n')
sys.stderr.write('\n')
sys.stderr.write('See <http://doc.supybot.aperio.fr/en/latest/use/faq.html#how-to-make-limnoria-use-python-3-instead-of-python-2>\n')
sys.stderr.write('\n')
warnings.warn('Running Limnoria on Python older than 2.7.9 is not '
'recommended because it does not support SSL '
'certificate verification. For more informations, see: '
'<http://doc.supybot.aperio.fr/en/latest/use/security.html#ssl-python-versions>',
DeprecationWarning)
elif sys.version_info < (3, 0):
pass # fine, for the moment
elif sys.version_info < (3, 4):
warnings.warn('Running Limnoria on Python 3.2 or 3.3 is not '
'recommended because these versions do not support SSL '
'certificate verification. For more informations, see: '
'<http://doc.supybot.aperio.fr/en/latest/use/security.html#ssl-python-versions>',
DeprecationWarning)
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -172,8 +172,7 @@ else:
elif verify:
logger.critical('This Python version does not support SSL/TLS '
'certification authority verification, which makes your '
'connection vulnerable to man-in-the-middle attacks.'
'You should consider upgrading to Python 3.4 or newer. '
'See <http://doc.supybot.aperio.fr/en/latest/use/faq.html#how-to-make-limnoria-use-python-3-instead-of-python-2>')
'connection vulnerable to man-in-the-middle attacks. See: '
'<http://doc.supybot.aperio.fr/en/latest/use/security.html#ssl-python-versions>')
return conn
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: