AMSC SSL 改用 httpx.Client(verify=False) 确保跳过证书验证

This commit is contained in:
2569718930@qq.com
2026-05-15 02:42:03 +08:00
parent 0f7322dbd8
commit 189a77d03d
+2 -1
View File
@@ -191,7 +191,8 @@ class AmscAwosSourceMixin:
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"}
response = httpx.get(url, headers=headers, timeout=getattr(self, "timeout", 10.0), verify=verify)
with httpx.Client(verify=verify) as client:
response = client.get(url, headers=headers, timeout=getattr(self, "timeout", 10.0))
response.raise_for_status()
try:
return response.json()