AMSC SSL 硬编码 verify=False,跳过证书验证环境变量依赖
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user