mirror of
https://github.com/ikunshare/Onekey.git
synced 2026-01-12 16:25:53 +08:00
Remove 'verify=False' from HTTP client instantiations
Eliminated the 'verify=False' parameter from all httpx.Client and httpx.AsyncClient initializations to enforce SSL certificate verification. This improves security by ensuring HTTPS requests validate server certificates.
This commit is contained in:
@@ -9,7 +9,7 @@ CONFIG_FILE: Path = Path("config.json")
|
||||
|
||||
def check_ip():
|
||||
try:
|
||||
with Client(verify=False, timeout=5.0) as client:
|
||||
with Client(timeout=5.0) as client:
|
||||
req = client.get(
|
||||
"https://mips.kugou.com/check/iscn",
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ class HttpClient:
|
||||
"""HTTP客户端封装"""
|
||||
|
||||
def __init__(self):
|
||||
self._client = httpx.AsyncClient(timeout=60.0, verify=False)
|
||||
self._client = httpx.AsyncClient(timeout=60.0)
|
||||
|
||||
async def get(self, url: str, headers: Optional[Dict] = None) -> httpx.Response:
|
||||
"""GET请求"""
|
||||
|
||||
@@ -206,9 +206,6 @@ templates = Jinja2Templates(directory=f"{base_path}/templates")
|
||||
web_app = WebOnekeyApp(manager)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def index(request: Request):
|
||||
"""主页"""
|
||||
@@ -395,7 +392,7 @@ async def get_key_info(request: Request):
|
||||
if not key:
|
||||
return JSONResponse({"success": False, "message": "卡密不能为空"})
|
||||
|
||||
async with httpx.AsyncClient(timeout=10.0, verify=False) as client:
|
||||
async with httpx.AsyncClient(timeout=10.0) as client:
|
||||
response = await client.post(
|
||||
f"{STEAM_API_BASE}/getKeyInfo",
|
||||
json={"key": key},
|
||||
|
||||
Reference in New Issue
Block a user