From 2970488f404149896e4ca0befa89e32feae8a9ad Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 18 Mar 2026 12:44:37 +1300 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=B0=86=E6=96=B0=E5=A2=9E=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=92=8C=E6=96=87=E6=A1=A3=E6=94=B9=E4=B8=BA=E4=B8=AD?= =?UTF-8?q?=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- config/base_config.py | 5 ++--- tools/httpx_util.py | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/config/base_config.py b/config/base_config.py index 7878ebf..83571e0 100644 --- a/config/base_config.py +++ b/config/base_config.py @@ -120,9 +120,8 @@ FONT_PATH = "./docs/STZHONGS.TTF" # Crawl interval CRAWLER_MAX_SLEEP_SEC = 2 -# Disable SSL certificate verification. Set to True only when running behind an intercepting -# proxy (corporate gateway, Burp Suite, mitmproxy, etc.) that injects its own certificate. -# WARNING: disabling SSL verification exposes all traffic to MITM attacks. +# 是否禁用 SSL 证书验证。仅在使用企业代理、Burp Suite、mitmproxy 等会注入自签名证书的中间人代理时设为 True。 +# 警告:禁用 SSL 验证将使所有流量暴露于中间人攻击风险,请勿在生产环境中开启。 DISABLE_SSL_VERIFY = False from .bilibili_config import * diff --git a/tools/httpx_util.py b/tools/httpx_util.py index 7647d06..7d32ea6 100644 --- a/tools/httpx_util.py +++ b/tools/httpx_util.py @@ -4,11 +4,10 @@ import config def make_async_client(**kwargs) -> httpx.AsyncClient: - """Create an httpx.AsyncClient with project-wide defaults. + """创建统一配置的 httpx.AsyncClient。 - Reads DISABLE_SSL_VERIFY from config (default False). - Set DISABLE_SSL_VERIFY = True in config/base_config.py only when running - behind an intercepting proxy (corporate gateway, Burp, mitmproxy, etc.). + 从配置文件读取 DISABLE_SSL_VERIFY(默认 False,即开启 SSL 验证)。 + 仅在使用企业代理、Burp、mitmproxy 等中间人代理时才需将其设为 True。 """ kwargs.setdefault("verify", not getattr(config, "DISABLE_SSL_VERIFY", False)) return httpx.AsyncClient(**kwargs)