bug: fix failed verification of SSL cert on whatsminer.

This commit is contained in:
UpstreamData
2023-07-24 20:19:00 -06:00
parent 4de950d8f4
commit d0d3fd3117
2 changed files with 4 additions and 11 deletions

View File

@@ -442,22 +442,15 @@ class BaseMiner(ABC):
else:
web_command_task = asyncio.sleep(0)
import pprint
from datetime import datetime
s1 = datetime.now()
web_command_data = await web_command_task
if web_command_data is None:
web_command_data = {}
print("WEB", datetime.now() - s1)
# pprint.pprint(web_command_data)
s2 = datetime.now()
api_command_data = await api_command_task
if api_command_data is None:
api_command_data = {}
print("API:", datetime.now() - s2)
# pprint.pprint(api_command_data)
miner_data = {}

View File

@@ -455,7 +455,7 @@ class MinerFactory:
async def _get_miner_web(self, ip: str):
urls = [f"http://{ip}/", f"https://{ip}/"]
async with httpx.AsyncClient() as session:
async with httpx.AsyncClient(verify=False) as session:
tasks = [asyncio.create_task(self._web_ping(session, url)) for url in urls]
text, resp = await concurrent_get_first_result(
@@ -578,7 +578,7 @@ class MinerFactory:
location: str,
auth: Optional[httpx.DigestAuth] = None,
) -> Optional[dict]:
async with httpx.AsyncClient() as session:
async with httpx.AsyncClient(verify=False) as session:
try:
data = await session.get(
f"http://{str(ip)}{location}",
@@ -760,7 +760,7 @@ class MinerFactory:
async def get_miner_model_innosilicon(self, ip: str) -> Optional[str]:
try:
async with httpx.AsyncClient() as session:
async with httpx.AsyncClient(verify=False) as session:
auth_req = await session.post(
f"http://{ip}/api/auth",
data={"username": "admin", "password": "admin"},
@@ -790,7 +790,7 @@ class MinerFactory:
pass
try:
async with httpx.AsyncClient() as session:
async with httpx.AsyncClient(verify=False) as session:
d = await session.post(
f"http://{ip}/graphql",
json={"query": "{bosminer {info{modelName}}}"},