SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[mod] upgrade to httpx 0.28.1 (#4674)
Alexandre Flament7a3742ae56cc
diff --git a/requirements.txt b/requirements.txtindex f985965e1..b4006c48e 100644--- a/requirements.txt+++ b/requirements.txt@@ -7,10 +7,10 @@ lxml==5.4.0pygments==2.19.1python-dateutil==2.9.0.post0pyyaml==6.0.2-httpx[http2]==0.24.1+httpx[http2]==0.28.1+httpx-socks[asyncio]==0.10.0Brotli==1.1.0uvloop==0.21.0-httpx-socks[asyncio]==0.7.7setproctitle==1.3.6redis==5.2.1markdown-it-py==3.0.0diff --git a/searx/network/client.py b/searx/network/client.pyindex 05d8e88fa..f35ba2d6e 100644--- a/searx/network/client.py+++ b/searx/network/client.py@@ -24,7 +24,7 @@ LOOP = NoneSSLCONTEXTS: Dict[Any, SSLContext] = {}-def shuffle_ciphers(ssl_context):+def shuffle_ciphers(ssl_context: SSLContext):"""Shuffle httpx's default ciphers of a SSL context randomly.From `What Is TLS Fingerprint and How to Bypass It`_@@ -41,16 +41,16 @@ def shuffle_ciphers(ssl_context):https://www.zenrows.com/blog/what-is-tls-fingerprint#how-to-bypass-tls-fingerprinting"""- c_list = httpx._config.DEFAULT_CIPHERS.split(':') # pylint: disable=protected-access+ c_list = [cipher["name"] for cipher in ssl_context.get_ciphers()]sc_list, c_list = c_list[:3], c_list[3:]random.shuffle(c_list)ssl_context.set_ciphers(":".join(sc_list + c_list))-def get_sslcontexts(proxy_url=None, cert=None, verify=True, trust_env=True, http2=False):- key = (proxy_url, cert, verify, trust_env, http2)+def get_sslcontexts(proxy_url=None, cert=None, verify=True, trust_env=True):+ key = (proxy_url, cert, verify, trust_env)if key not in SSLCONTEXTS:- SSLCONTEXTS[key] = httpx.create_ssl_context(cert, verify, trust_env, http2)+ SSLCONTEXTS[key] = httpx.create_ssl_context(verify, cert, trust_env)shuffle_ciphers(SSLCONTEXTS[key])return SSLCONTEXTS[key]@@ -120,7 +120,7 @@ def get_transport_for_socks_proxy(verify, http2, local_address, proxy_url, limitrdns = Trueproxy_type, proxy_host, proxy_port, proxy_username, proxy_password = parse_proxy_url(proxy_url)- verify = get_sslcontexts(proxy_url, None, verify, True, http2) if verify is True else verify+ verify = get_sslcontexts(proxy_url, None, verify, True) if verify is True else verifyreturn AsyncProxyTransportFixed(proxy_type=proxy_type,proxy_host=proxy_host,@@ -138,7 +138,7 @@ def get_transport_for_socks_proxy(verify, http2, local_address, proxy_url, limitdef get_transport(verify, http2, local_address, proxy_url, limit, retries):- verify = get_sslcontexts(None, None, verify, True, http2) if verify is True else verify+ verify = get_sslcontexts(None, None, verify, True) if verify is True else verifyreturn httpx.AsyncHTTPTransport(# pylint: disable=protected-accessverify=verify,