diff options
author | misnyo <misnyo@misnyo.eu> | 2015-12-29 19:16:26 +0100 |
---|---|---|
committer | misnyo <misnyo@misnyo.eu> | 2015-12-29 19:42:16 +0100 |
commit | 35a2bc5650b09d46c4b3a6b2c99ee521a09ef73f (patch) | |
tree | 802e46845d87b3191b98f84363bf59b42d4d151b /searx/__init__.py | |
parent | c350def84bb5603f99859e3a5a9824cc356e613b (diff) | |
download | searxng-35a2bc5650b09d46c4b3a6b2c99ee521a09ef73f.tar.gz searxng-35a2bc5650b09d46c4b3a6b2c99ee521a09ef73f.zip |
[fix] #471 #463 fix old openssl(<1.0.2) requests verify error
Diffstat (limited to 'searx/__init__.py')
-rw-r--r-- | searx/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/__init__.py b/searx/__init__.py index ea21e8f13..76038a443 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -15,9 +15,11 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >. (C) 2013- by Adam Tauber, <asciimoo@gmail.com> ''' +import certifi import logging from os import environ from os.path import realpath, dirname, join, abspath +from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION try: from yaml import load except: @@ -47,4 +49,10 @@ else: logger = logging.getLogger('searx') +# Workaround for openssl versions <1.0.2 +# https://github.com/certifi/python-certifi/issues/26 +if OPENSSL_VERSION_INFO[0:3] < (1, 0, 2): + environ['REQUESTS_CA_BUNDLE'] = certifi.old_where() + logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION)) + logger.info('Initialisation done') |