on master help sign in
[fix] #471 #463 fix old openssl(<1.0.2) requests verify error
35a2bc5misnyo
searx/__init__.py+8
@@ -15,9 +15,11 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
15(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
15(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
16'''
16'''
17
17
18+import certifi
18import logging
19import logging
19from os import environ
20from os import environ
20from os.path import realpath, dirname, join, abspath
21from os.path import realpath, dirname, join, abspath
22+from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION
21try:
23try:
22 from yaml import load
24 from yaml import load
23except:
25except:
@@ -47,4 +49,10 @@ else:
47
49
48logger = logging.getLogger('searx')
50logger = logging.getLogger('searx')
49
51
52+# Workaround for openssl versions <1.0.2
53+# https://github.com/certifi/python-certifi/issues/26
54+if OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):
55+ environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
56+ logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))
57+
50logger.info('Initialisation done')
58logger.info('Initialisation done')
versions.cfg+1−1
@@ -35,7 +35,7 @@ pyopenssl = 0.15.1
35ndg-httpsclient = 0.4.0
35ndg-httpsclient = 0.4.0
36pyasn1 = 0.1.8
36pyasn1 = 0.1.8
37pyasn1-modules = 0.0.6
37pyasn1-modules = 0.0.6
38−certifi = 2015.04.28
38+certifi = 2015.11.20.1
39
39
40cffi = 1.1.2
40cffi = 1.1.2
41cryptography = 0.9.1
41cryptography = 0.9.1