From 87fedb8a6d9faf1ba510b40ed1ffc97ea3d404cb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 10 Mar 2014 11:53:50 +0530 Subject: [PATCH] I love linux distros --- setup/linux-installer.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/setup/linux-installer.py b/setup/linux-installer.py index ddfe093c8c..a51878328c 100644 --- a/setup/linux-installer.py +++ b/setup/linux-installer.py @@ -448,10 +448,16 @@ def match_hostname(cert, hostname): "doesn't match either of %s" % (hostname, ', '.join(map(repr, dnsnames)))) elif len(dnsnames) == 1: - # python 2.6 does not read subjectAltName, so we do the best we can - if sys.version_info[:2] <= (2, 6): - if dnsnames[0] == 'calibre-ebook.com': - return + # python 2.7.2 does not read subject alt names thanks to this + # bug: http://bugs.python.org/issue13034 + # And the utter lunacy that is the linux landscape could have + # any old version of python whatsoever with or without a hot fix for + # this bug. Not to mention that python 2.6 may or may not + # read alt names depending on its patchlevel. So we just bail on full + # verification if the python version is less than 2.7.3. + # Linux distros are one enormous, honking disaster. + if sys.version_info[:3] < (2, 7, 3) and dnsnames[0] == 'calibre-ebook.com': + return raise CertificateError("hostname %r " "doesn't match %r" % (hostname, dnsnames[0]))