diff options
author | Alexandre Flament <alex@al-f.net> | 2022-07-19 23:40:11 +0200 |
---|---|---|
committer | Alexandre FLAMENT <alexandre.flament@hesge.ch> | 2022-10-14 13:59:22 +0000 |
commit | 32e8c2cf098ae59baae5672e70436e47299bec82 (patch) | |
tree | 2b70a212b2ccc5e26e77690f8a766f6e573c3c77 /searx/webapp.py | |
parent | 72f6367e2323b2c57b2bb479dbadccd5b690a986 (diff) | |
download | searxng-32e8c2cf098ae59baae5672e70436e47299bec82.tar.gz searxng-32e8c2cf098ae59baae5672e70436e47299bec82.zip |
searx.network: add "verify" option to the networks
Each network can define a verify option:
* false to disable certificate verification
* a path to existing certificate.
SearXNG uses SSL_CERT_FILE and SSL_CERT_DIR when they are defined
see https://www.python-httpx.org/environment_variables/#ssl_cert_file
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-x | searx/webapp.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 688698bb6..5c3fbae8b 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -165,6 +165,7 @@ timeout_text = gettext('timeout') parsing_error_text = gettext('parsing error') http_protocol_error_text = gettext('HTTP protocol error') network_error_text = gettext('network error') +ssl_cert_error_text = gettext("SSL error: certificate validation has failed") exception_classname_to_text = { None: gettext('unexpected crash'), 'timeout': timeout_text, @@ -189,6 +190,8 @@ exception_classname_to_text = { 'KeyError': parsing_error_text, 'json.decoder.JSONDecodeError': parsing_error_text, 'lxml.etree.ParserError': parsing_error_text, + 'ssl.SSLCertVerificationError': ssl_cert_error_text, # for Python > 3.7 + 'ssl.CertificateError': ssl_cert_error_text, # for Python 3.7 } |