Skip to content

Commit

Permalink
Add Hippolyzer proxy support to client
Browse files Browse the repository at this point in the history
  • Loading branch information
SaladDais committed Dec 12, 2023
1 parent d5cde89 commit ed7e426
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hippolyzer/lib/client/hippo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def __init__(self, options: Optional[Set[str]] = None):
self._password: Optional[str] = None
self._mac = uuid.getnode()
self._options = options if options is not None else self.DEFAULT_OPTIONS
self.http_session: Optional[aiohttp.ClientSession] = aiohttp.ClientSession()
self.http_session: Optional[aiohttp.ClientSession] = aiohttp.ClientSession(trust_env=True)
self.session: Optional[HippoClientSession] = None
self.settings = ClientSettings()
self._resend_task: Optional[asyncio.Task] = None
Expand Down Expand Up @@ -387,8 +387,12 @@ async def login(
"version": version("hippolyzer"),
"options": list(self._options),
}
rpc_payload = xmlrpc.client.dumps((payload,), "login_to_simulator")
async with self.http_session.post(login_uri, data=rpc_payload, headers={"Content-Type": "text/xml"}) as resp:
async with self.http_session.post(
login_uri,
data=xmlrpc.client.dumps((payload,), "login_to_simulator"),
headers={"Content-Type": "text/xml"},
ssl=self.settings.SSL_VERIFY,
) as resp:
resp.raise_for_status()
login_data = xmlrpc.client.loads((await resp.read()).decode("utf8"))[0][0]
self.session = HippoClientSession.from_login_data(login_data, self)
Expand Down

0 comments on commit ed7e426

Please sign in to comment.