summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2015-04-26 18:58:31 +0200
committerAlexandre Flament <alex@al-f.net>2015-04-26 18:58:31 +0200
commit187617498a0dea17e51950f1ad5e96bb4826367d (patch)
treea53fd9de463db62ad8cee29c22fa376b2141877e /searx/webapp.py
parent2be52b74ad9e30474d553750d802199ee8cc4844 (diff)
downloadsearxng-187617498a0dea17e51950f1ad5e96bb4826367d.tar.gz
searxng-187617498a0dea17e51950f1ad5e96bb4826367d.zip
Log an error if the ndg-httpsclient, pyopenssl and pyasn1 packages are not installed.
See #298
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 13c965e0d..38780220e 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -61,6 +61,16 @@ except:
from sys import exit
exit(1)
+# check if the pyopenssl, ndg-httpsclient, pyasn1 packages are installed.
+# They are needed for SSL connection without trouble, see #298
+try:
+ import OpenSSL.SSL # NOQA
+ import ndg.httpsclient # NOQA
+ import pyasn1 # NOQA
+except ImportError:
+ logger.critical("The pyopenssl, ndg-httpsclient, pyasn1 packages have to be installed.\n"
+ "Some HTTPS connections will failed")
+
logger = logger.getChild('webapp')