bug: fix failed verification of SSL cert on whatsminer.
This commit is contained in:
@@ -442,22 +442,15 @@ class BaseMiner(ABC):
|
|||||||
else:
|
else:
|
||||||
web_command_task = asyncio.sleep(0)
|
web_command_task = asyncio.sleep(0)
|
||||||
|
|
||||||
import pprint
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
s1 = datetime.now()
|
|
||||||
web_command_data = await web_command_task
|
web_command_data = await web_command_task
|
||||||
if web_command_data is None:
|
if web_command_data is None:
|
||||||
web_command_data = {}
|
web_command_data = {}
|
||||||
print("WEB", datetime.now() - s1)
|
|
||||||
# pprint.pprint(web_command_data)
|
|
||||||
|
|
||||||
s2 = datetime.now()
|
|
||||||
api_command_data = await api_command_task
|
api_command_data = await api_command_task
|
||||||
if api_command_data is None:
|
if api_command_data is None:
|
||||||
api_command_data = {}
|
api_command_data = {}
|
||||||
print("API:", datetime.now() - s2)
|
|
||||||
# pprint.pprint(api_command_data)
|
|
||||||
|
|
||||||
miner_data = {}
|
miner_data = {}
|
||||||
|
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ class MinerFactory:
|
|||||||
|
|
||||||
async def _get_miner_web(self, ip: str):
|
async def _get_miner_web(self, ip: str):
|
||||||
urls = [f"http://{ip}/", f"https://{ip}/"]
|
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]
|
tasks = [asyncio.create_task(self._web_ping(session, url)) for url in urls]
|
||||||
|
|
||||||
text, resp = await concurrent_get_first_result(
|
text, resp = await concurrent_get_first_result(
|
||||||
@@ -578,7 +578,7 @@ class MinerFactory:
|
|||||||
location: str,
|
location: str,
|
||||||
auth: Optional[httpx.DigestAuth] = None,
|
auth: Optional[httpx.DigestAuth] = None,
|
||||||
) -> Optional[dict]:
|
) -> Optional[dict]:
|
||||||
async with httpx.AsyncClient() as session:
|
async with httpx.AsyncClient(verify=False) as session:
|
||||||
try:
|
try:
|
||||||
data = await session.get(
|
data = await session.get(
|
||||||
f"http://{str(ip)}{location}",
|
f"http://{str(ip)}{location}",
|
||||||
@@ -760,7 +760,7 @@ class MinerFactory:
|
|||||||
|
|
||||||
async def get_miner_model_innosilicon(self, ip: str) -> Optional[str]:
|
async def get_miner_model_innosilicon(self, ip: str) -> Optional[str]:
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient() as session:
|
async with httpx.AsyncClient(verify=False) as session:
|
||||||
auth_req = await session.post(
|
auth_req = await session.post(
|
||||||
f"http://{ip}/api/auth",
|
f"http://{ip}/api/auth",
|
||||||
data={"username": "admin", "password": "admin"},
|
data={"username": "admin", "password": "admin"},
|
||||||
@@ -790,7 +790,7 @@ class MinerFactory:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient() as session:
|
async with httpx.AsyncClient(verify=False) as session:
|
||||||
d = await session.post(
|
d = await session.post(
|
||||||
f"http://{ip}/graphql",
|
f"http://{ip}/graphql",
|
||||||
json={"query": "{bosminer {info{modelName}}}"},
|
json={"query": "{bosminer {info{modelName}}}"},
|
||||||
|
|||||||
Reference in New Issue
Block a user