Explorar el Código

Merge branch 'master' into wolframalpha

a01200356 hace 9 años
padre
commit
d4b6ab2be4
Se han modificado 3 ficheros con 16 adiciones y 6 borrados
  1. 8
    0
      searx/__init__.py
  2. 7
    5
      searx/settings.yml
  3. 1
    1
      versions.cfg

+ 8
- 0
searx/__init__.py Ver fichero

@@ -15,9 +15,11 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
15 15
 (C) 2013- by Adam Tauber, <asciimoo@gmail.com>
16 16
 '''
17 17
 
18
+import certifi
18 19
 import logging
19 20
 from os import environ
20 21
 from os.path import realpath, dirname, join, abspath
22
+from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION
21 23
 try:
22 24
     from yaml import load
23 25
 except:
@@ -47,4 +49,10 @@ else:
47 49
 
48 50
 logger = 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
+
50 58
 logger.info('Initialisation done')

+ 7
- 5
searx/settings.yml Ver fichero

@@ -300,11 +300,13 @@ engines:
300 300
     engine : vimeo
301 301
     shortcut : vm
302 302
 
303
-  - name : wolframalpha
304
-    shortcut : wa
305
-    engine : wolframalpha_api
306
-    api_key: '5952JX-X52L3VKWT8'
307
-    timeout: 6.0
303
+# You can use the engine using the official stable API, but you need an API key
304
+# See : http://products.wolframalpha.com/api/
305
+#  - name : wolframalpha
306
+#    shortcut : wa
307
+#    engine : wolframalpha_api
308
+#    api_key: 'apikey' # required!
309
+#    timeout: 6.0
308 310
 
309 311
 #The blekko technology and team have joined IBM Watson! -> https://blekko.com/
310 312
 #  - name : blekko images

+ 1
- 1
versions.cfg Ver fichero

@@ -35,7 +35,7 @@ pyopenssl = 0.15.1
35 35
 ndg-httpsclient = 0.4.0
36 36
 pyasn1 = 0.1.8
37 37
 pyasn1-modules = 0.0.6
38
-certifi = 2015.04.28
38
+certifi = 2015.11.20.1
39 39
 
40 40
 cffi = 1.1.2
41 41
 cryptography = 0.9.1