AMSC SSL 硬编码 verify=False,跳过证书验证环境变量依赖

This commit is contained in:
2569718930@qq.com
2026-05-15 03:13:30 +08:00
parent 06df0a87dd
commit 6655476fd4
+1 -3
View File
@@ -191,9 +191,7 @@ class AmscAwosSourceMixin:
return headers
def _http_get_json(self, url: str, *, headers: Optional[Dict[str, str]] = None) -> Optional[Dict[str, Any]]:
verify = os.getenv("POLYWEATHER_AMSC_SSL_VERIFY", "true").strip().lower() not in {"0", "false", "no"}
logger.info("AMSC AWOS _http_get_json verify={} url={}", verify, str(url)[:80])
with httpx.Client(verify=verify) as client:
with httpx.Client(verify=False) as client:
response = client.get(url, headers=headers, timeout=getattr(self, "timeout", 10.0))
response.raise_for_status()
try: